From 997ff8f14a232657c765dad6017e7a9b1fed6228 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 23 Apr 2023 17:49:55 +0800 Subject: [PATCH] Translate undo/redo messages in settings dialogs --- editor/editor_settings_dialog.cpp | 4 ++-- editor/project_settings_editor.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp index 9ac52e6ace56..548492e4883c 100644 --- a/editor/editor_settings_dialog.cpp +++ b/editor/editor_settings_dialog.cpp @@ -170,7 +170,7 @@ void EditorSettingsDialog::shortcut_input(const Ref &p_event) { if (ED_IS_SHORTCUT("ui_undo", p_event)) { String action = undo_redo->get_current_action_name(); if (!action.is_empty()) { - EditorNode::get_log()->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); + EditorNode::get_log()->add_message(vformat(TTR("Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); } undo_redo->undo(); handled = true; @@ -180,7 +180,7 @@ void EditorSettingsDialog::shortcut_input(const Ref &p_event) { undo_redo->redo(); String action = undo_redo->get_current_action_name(); if (!action.is_empty()) { - EditorNode::get_log()->add_message("Redo: " + action, EditorLog::MSG_TYPE_EDITOR); + EditorNode::get_log()->add_message(vformat(TTR("Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); } handled = true; } diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 5c159d54ac1c..1cd863fb8a83 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -236,7 +236,7 @@ void ProjectSettingsEditor::shortcut_input(const Ref &p_event) { if (ED_IS_SHORTCUT("ui_undo", p_event)) { String action = undo_redo->get_current_action_name(); if (!action.is_empty()) { - EditorNode::get_log()->add_message("Undo: " + action, EditorLog::MSG_TYPE_EDITOR); + EditorNode::get_log()->add_message(vformat(TTR("Undo: %s"), action), EditorLog::MSG_TYPE_EDITOR); } undo_redo->undo(); handled = true; @@ -246,7 +246,7 @@ void ProjectSettingsEditor::shortcut_input(const Ref &p_event) { undo_redo->redo(); String action = undo_redo->get_current_action_name(); if (!action.is_empty()) { - EditorNode::get_log()->add_message("Redo: " + action, EditorLog::MSG_TYPE_EDITOR); + EditorNode::get_log()->add_message(vformat(TTR("Redo: %s"), action), EditorLog::MSG_TYPE_EDITOR); } handled = true; }