Browse Source

Translate undo/redo messages in settings dialogs

Haoyu Qiu 2 years ago
parent
commit
997ff8f14a
2 changed files with 4 additions and 4 deletions
  1. 2 2
      editor/editor_settings_dialog.cpp
  2. 2 2
      editor/project_settings_editor.cpp

+ 2 - 2
editor/editor_settings_dialog.cpp

@@ -170,7 +170,7 @@ void EditorSettingsDialog::shortcut_input(const Ref<InputEvent> &p_event) {
 		if (ED_IS_SHORTCUT("ui_undo", p_event)) {
 		if (ED_IS_SHORTCUT("ui_undo", p_event)) {
 			String action = undo_redo->get_current_action_name();
 			String action = undo_redo->get_current_action_name();
 			if (!action.is_empty()) {
 			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();
 			undo_redo->undo();
 			handled = true;
 			handled = true;
@@ -180,7 +180,7 @@ void EditorSettingsDialog::shortcut_input(const Ref<InputEvent> &p_event) {
 			undo_redo->redo();
 			undo_redo->redo();
 			String action = undo_redo->get_current_action_name();
 			String action = undo_redo->get_current_action_name();
 			if (!action.is_empty()) {
 			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;
 			handled = true;
 		}
 		}

+ 2 - 2
editor/project_settings_editor.cpp

@@ -236,7 +236,7 @@ void ProjectSettingsEditor::shortcut_input(const Ref<InputEvent> &p_event) {
 		if (ED_IS_SHORTCUT("ui_undo", p_event)) {
 		if (ED_IS_SHORTCUT("ui_undo", p_event)) {
 			String action = undo_redo->get_current_action_name();
 			String action = undo_redo->get_current_action_name();
 			if (!action.is_empty()) {
 			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();
 			undo_redo->undo();
 			handled = true;
 			handled = true;
@@ -246,7 +246,7 @@ void ProjectSettingsEditor::shortcut_input(const Ref<InputEvent> &p_event) {
 			undo_redo->redo();
 			undo_redo->redo();
 			String action = undo_redo->get_current_action_name();
 			String action = undo_redo->get_current_action_name();
 			if (!action.is_empty()) {
 			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;
 			handled = true;
 		}
 		}