From 2c3646b37b5f8c4625d4ba19c66c717e32909fe7 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 7 Mar 2022 21:50:02 +0800 Subject: [PATCH] Add missing i18n to various strings (cherry picked from commit 25d93200c826bd47235697128f002c7a9d81952a) --- editor/animation_track_editor.cpp | 12 ++++++++---- editor/editor_help_search.cpp | 2 +- editor/editor_node.cpp | 2 +- editor/import/resource_importer_texture.cpp | 2 +- editor/plugins/animation_blend_space_1d_editor.cpp | 2 +- editor/plugins/animation_blend_space_2d_editor.cpp | 2 +- editor/plugins/animation_state_machine_editor.cpp | 2 +- editor/plugins/mesh_library_editor_plugin.cpp | 4 ++-- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index a2d3fe29b1d..697027f41bb 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5302,22 +5302,26 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { } } + String track_type; switch (animation->track_get_type(i)) { case Animation::TYPE_TRANSFORM: - text += " (Transform)"; + track_type = TTR("Transform"); break; case Animation::TYPE_METHOD: - text += " (Methods)"; + track_type = TTR("Methods"); break; case Animation::TYPE_BEZIER: - text += " (Bezier)"; + track_type = TTR("Bezier"); break; case Animation::TYPE_AUDIO: - text += " (Audio)"; + track_type = TTR("Audio"); break; default: { }; } + if (!track_type.empty()) { + text += vformat(" (%s)", track_type); + } TreeItem *it = track_copy_select->create_item(troot); it->set_editable(0, true); diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 45e01fabbb3..c4249c9e5e1 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -494,7 +494,7 @@ TreeItem *EditorHelpSearch::Runner::_create_class_item(TreeItem *p_parent, const } else if (ClassDB::class_exists(p_doc->name) && ClassDB::is_parent_class(p_doc->name, "Object")) { icon = ui_service->get_icon("Object", "EditorIcons"); } - String tooltip = p_doc->brief_description.strip_edges(); + String tooltip = DTR(p_doc->brief_description.strip_edges()); TreeItem *item = results_tree->create_item(p_parent); item->set_icon(0, icon); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d5486234322..fc46fe910fe 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5377,7 +5377,7 @@ void EditorNode::_add_dropped_files_recursive(const Vector &p_files, Str } void EditorNode::_file_access_close_error_notify(const String &p_str) { - add_io_error("Unable to write to file '" + p_str + "', file in use, locked or lacking permissions."); + add_io_error(vformat(TTR("Unable to write to file '%s', file in use, locked or lacking permissions."), p_str)); } void EditorNode::reload_scene(const String &p_path) { diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index c6194b1459d..cf1ec5b2ecc 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -560,7 +560,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String } if (!ok_on_pc) { - EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correctly on PC."); + EditorNode::add_io_error(TTR("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correctly on PC.")); } } else { //import normally diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index b6e1b9de106..06e1d145c0e 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -86,7 +86,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Refget_item_count(); - menu->add_item(vformat("Add %s", name), idx); + menu->add_item(vformat(TTR("Add %s"), name), idx); menu->set_item_metadata(idx, E->get()); } diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index b40f9bc73d4..61797fce9a1 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -109,7 +109,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Refget_item_count(); - menu->add_item(vformat("Add %s", name), idx); + menu->add_item(vformat(TTR("Add %s"), name), idx); menu->set_item_metadata(idx, E->get()); } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 83409cdca4c..a85b0f8422c 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -106,7 +106,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Refget_item_count(); - menu->add_item(vformat("Add %s", name), idx); + menu->add_item(vformat(TTR("Add %s"), name), idx); menu->set_item_metadata(idx, E->get()); } Ref clipb = EditorSettings::get_singleton()->get_resource_clipboard(); diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index 7bcd89cae84..b45586e2a89 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -292,9 +292,9 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { cd_remove->get_ok()->connect("pressed", this, "_menu_remove_confirm"); cd_update = memnew(ConfirmationDialog); add_child(cd_update); - cd_update->get_ok()->set_text("Apply without Transforms"); + cd_update->get_ok()->set_text(TTR("Apply without Transforms")); cd_update->get_ok()->connect("pressed", this, "_menu_update_confirm", varray(false)); - cd_update->add_button("Apply with Transforms")->connect("pressed", this, "_menu_update_confirm", varray(true)); + cd_update->add_button(TTR("Apply with Transforms"))->connect("pressed", this, "_menu_update_confirm", varray(true)); } void MeshLibraryEditorPlugin::edit(Object *p_node) {