diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-08-23 22:25:14 +0200 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-25 18:49:45 +0200 |
commit | 6134d8741d6b255751e7b2811be85b60ef916269 (patch) | |
tree | 27edc499e4ecced86630715232f7adfa62f9b3c4 | |
parent | a1c03a69d2940fb69d7221800e919f4a183fec0c (diff) |
Editor: Add some more translatable strings.
30 files changed, 126 insertions, 132 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 56759a8086..c2e173c040 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -800,7 +800,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) { tree->set_v_size_flags(SIZE_EXPAND_FILL); connect_button = memnew(Button); - connect_button->set_text("Connect"); + connect_button->set_text(TTR("Connect")); HBoxContainer *hb = memnew(HBoxContainer); vbc->add_child(hb); hb->add_spacer(); diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 6c05a9ef80..caed426b2d 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -89,7 +89,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { unzFile pkg = unzOpen2(p_path.utf8().get_data(), &io); if (!pkg) { - error->set_text("Error opening package file, not in zip format."); + error->set_text(TTR("Error opening package file, not in zip format.")); return; } @@ -221,7 +221,7 @@ void EditorAssetInstaller::ok_pressed() { unzFile pkg = unzOpen2(package_path.utf8().get_data(), &io); if (!pkg) { - error->set_text("Error opening package file, not in zip format."); + error->set_text(TTR("Error opening package file, not in zip format.")); return; } @@ -229,7 +229,7 @@ void EditorAssetInstaller::ok_pressed() { Vector<String> failed_files; - ProgressDialog::get_singleton()->add_task("uncompress", "Uncompressing Assets", status_map.size()); + ProgressDialog::get_singleton()->add_task("uncompress", TTR("Uncompressing Assets"), status_map.size()); int idx = 0; while (ret == UNZ_OK) { @@ -304,7 +304,7 @@ void EditorAssetInstaller::ok_pressed() { EditorNode::get_singleton()->show_warning(msg); } else { if (EditorNode::get_singleton() != NULL) - EditorNode::get_singleton()->show_warning("Package Installed Successfully!", "Success!"); + EditorNode::get_singleton()->show_warning(TTR("Package Installed Successfully!"), TTR("Success!")); } EditorFileSystem::get_singleton()->scan_changes(); } @@ -325,8 +325,8 @@ EditorAssetInstaller::EditorAssetInstaller() { error = memnew(AcceptDialog); add_child(error); - get_ok()->set_text("Install"); - set_title("Package Installer"); + get_ok()->set_text(TTR("Install")); + set_title(TTR("Package Installer")); updating = false; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 3494aa577d..1f72a59a14 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -128,7 +128,7 @@ void EditorAudioBus::update_send() { send->clear(); if (get_index() == 0) { send->set_disabled(true); - send->set_text("Speakers"); + send->set_text(TTR("Speakers")); } else { send->set_disabled(false); StringName current_send = AudioServer::get_singleton()->get_bus_send(get_index()); @@ -183,7 +183,7 @@ void EditorAudioBus::update_bus() { add->set_cell_mode(0, TreeItem::CELL_MODE_CUSTOM); add->set_editable(0, true); add->set_selectable(0, false); - add->set_text(0, "Add Effect"); + add->set_text(0, TTR("Add Effect")); update_send(); @@ -221,7 +221,7 @@ void EditorAudioBus::_name_changed(const String &p_new_name) { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); StringName current = AudioServer::get_singleton()->get_bus_name(get_index()); - ur->create_action("Rename Audio Bus"); + ur->create_action(TTR("Rename Audio Bus")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_name", get_index(), attempt); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_name", get_index(), current); @@ -264,7 +264,7 @@ void EditorAudioBus::_solo_toggled() { updating_bus = true; UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Toggle Audio Bus Solo"); + ur->create_action(TTR("Toggle Audio Bus Solo")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), solo->is_pressed()); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_solo", get_index(), AudioServer::get_singleton()->is_bus_solo(get_index())); ur->add_do_method(buses, "_update_bus", get_index()); @@ -278,7 +278,7 @@ void EditorAudioBus::_mute_toggled() { updating_bus = true; UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Toggle Audio Bus Mute"); + ur->create_action(TTR("Toggle Audio Bus Mute")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), mute->is_pressed()); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_mute", get_index(), AudioServer::get_singleton()->is_bus_mute(get_index())); ur->add_do_method(buses, "_update_bus", get_index()); @@ -292,7 +292,7 @@ void EditorAudioBus::_bypass_toggled() { updating_bus = true; UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Toggle Audio Bus Bypass Effects"); + ur->create_action(TTR("Toggle Audio Bus Bypass Effects")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), bypass->is_pressed()); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_bypass_effects", get_index(), AudioServer::get_singleton()->is_bus_bypassing_effects(get_index())); ur->add_do_method(buses, "_update_bus", get_index()); @@ -356,7 +356,7 @@ void EditorAudioBus::_effect_edited() { updating_bus = true; UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Select Audio Bus Send"); + ur->create_action(TTR("Select Audio Bus Send")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, effect->is_checked(0)); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, AudioServer::get_singleton()->is_bus_effect_enabled(get_index(), index)); ur->add_do_method(buses, "_update_bus", get_index()); @@ -383,7 +383,7 @@ void EditorAudioBus::_effect_add(int p_which) { afxr->set_name(effect_options->get_item_text(p_which)); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Add Audio Bus Effect"); + ur->create_action(TTR("Add Audio Bus Effect")); ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), afxr, -1); ur->add_undo_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect_count(get_index())); ur->add_do_method(buses, "_update_bus", get_index()); @@ -526,7 +526,7 @@ void EditorAudioBus::drop_data_fw(const Point2 &p_point, const Variant &p_data, bool enabled = AudioServer::get_singleton()->is_bus_effect_enabled(bus, effect); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Move Bus Effect"); + ur->create_action(TTR("Move Bus Effect")); ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", bus, effect); ur->add_do_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(bus, effect), paste_at); @@ -567,7 +567,7 @@ void EditorAudioBus::_delete_effect_pressed(int p_option) { int index = item->get_metadata(0); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Delete Bus Effect"); + ur->create_action(TTR("Delete Bus Effect")); ur->add_do_method(AudioServer::get_singleton(), "remove_bus_effect", get_index(), index); ur->add_undo_method(AudioServer::get_singleton(), "add_bus_effect", get_index(), AudioServer::get_singleton()->get_bus_effect(get_index(), index), index); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_effect_enabled", get_index(), index, AudioServer::get_singleton()->is_bus_effect_enabled(get_index(), index)); @@ -736,13 +736,13 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { } delete_popup = bus_options->get_popup(); - delete_popup->add_item("Duplicate"); - delete_popup->add_item("Delete"); + delete_popup->add_item(TTR("Duplicate")); + delete_popup->add_item(TTR("Delete")); add_child(delete_popup); delete_popup->connect("index_pressed", this, "_delete_pressed"); delete_effect_popup = memnew(PopupMenu); - delete_effect_popup->add_item("Delete Effect"); + delete_effect_popup->add_item(TTR("Delete Effect")); add_child(delete_effect_popup); delete_effect_popup->connect("index_pressed", this, "_delete_effect_pressed"); } @@ -840,7 +840,7 @@ void EditorAudioBuses::_add_bus() { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); //need to simulate new name, so we can undi :( - ur->create_action("Add Audio Bus"); + ur->create_action(TTR("Add Audio Bus")); ur->add_do_method(AudioServer::get_singleton(), "set_bus_count", AudioServer::get_singleton()->get_bus_count() + 1); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_count", AudioServer::get_singleton()->get_bus_count()); ur->add_do_method(this, "_update_buses"); @@ -868,13 +868,13 @@ void EditorAudioBuses::_delete_bus(Object *p_which) { EditorAudioBus *bus = Object::cast_to<EditorAudioBus>(p_which); int index = bus->get_index(); if (index == 0) { - EditorNode::get_singleton()->show_warning("Master bus can't be deleted!"); + EditorNode::get_singleton()->show_warning(TTR("Master bus can't be deleted!")); return; } UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Delete Audio Bus"); + ur->create_action(TTR("Delete Audio Bus")); ur->add_do_method(AudioServer::get_singleton(), "remove_bus", index); ur->add_undo_method(AudioServer::get_singleton(), "add_bus", index); ur->add_undo_method(AudioServer::get_singleton(), "set_bus_name", index, AudioServer::get_singleton()->get_bus_name(index)); @@ -897,7 +897,7 @@ void EditorAudioBuses::_duplicate_bus(int p_which) { int add_at_pos = p_which + 1; UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Duplicate Audio Bus"); + ur->create_action(TTR("Duplicate Audio Bus")); ur->add_do_method(AudioServer::get_singleton(), "add_bus", add_at_pos); ur->add_do_method(AudioServer::get_singleton(), "set_bus_name", add_at_pos, AudioServer::get_singleton()->get_bus_name(p_which) + " Copy"); ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", add_at_pos, AudioServer::get_singleton()->get_bus_volume_db(p_which)); @@ -932,7 +932,7 @@ void EditorAudioBuses::_drop_at_index(int p_bus, int p_index) { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); //need to simulate new name, so we can undi :( - ur->create_action("Move Audio Bus"); + ur->create_action(TTR("Move Audio Bus")); ur->add_do_method(AudioServer::get_singleton(), "move_bus", p_bus, p_index); int final_pos; if (p_index == p_bus) { @@ -993,7 +993,7 @@ void EditorAudioBuses::_load_default_layout() { Ref<AudioBusLayout> state = ResourceLoader::load("res://default_bus_layout.tres"); if (state.is_null()) { - EditorNode::get_singleton()->show_warning("There is no 'res://default_bus_layout.tres' file."); + EditorNode::get_singleton()->show_warning(TTR("There is no 'res://default_bus_layout.tres' file.")); return; } @@ -1010,7 +1010,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) { if (file_dialog->get_mode() == EditorFileDialog::MODE_OPEN_FILE) { Ref<AudioBusLayout> state = ResourceLoader::load(p_string); if (state.is_null()) { - EditorNode::get_singleton()->show_warning("Invalid file, not an audio bus layout."); + EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout.")); return; } @@ -1144,7 +1144,7 @@ void EditorAudioBuses::open_layout(const String &p_path) { Ref<AudioBusLayout> state = ResourceLoader::load(p_path); if (state.is_null()) { - EditorNode::get_singleton()->show_warning("Invalid file, not an audio bus layout."); + EditorNode::get_singleton()->show_warning(TTR("Invalid file, not an audio bus layout.")); return; } diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 12c55d9671..80d3abcf0c 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -184,7 +184,7 @@ void EditorDirDialog::_make_dir() { TreeItem *ti = tree->get_selected(); if (!ti) { - mkdirerr->set_text("Please select a base directory first"); + mkdirerr->set_text(TTR("Please select a base directory first")); mkdirerr->popup_centered_minsize(); return; } diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 26dbc27136..6e4a848517 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -809,27 +809,27 @@ void EditorFileDialog::set_mode(Mode p_mode) { case MODE_OPEN_FILE: get_ok()->set_text(TTR("Open")); - set_title("Open a File"); + set_title(TTR("Open a File")); makedir->hide(); break; case MODE_OPEN_FILES: get_ok()->set_text(TTR("Open")); - set_title("Open File(s)"); + set_title(TTR("Open File(s)")); makedir->hide(); break; case MODE_OPEN_DIR: get_ok()->set_text(TTR("Open")); - set_title("Open a Directory"); + set_title(TTR("Open a Directory")); makedir->show(); break; case MODE_OPEN_ANY: get_ok()->set_text(TTR("Open")); - set_title("Open a File or Directory"); + set_title(TTR("Open a File or Directory")); makedir->show(); break; case MODE_SAVE_FILE: get_ok()->set_text(TTR("Save")); - set_title("Save a File"); + set_title(TTR("Save a File")); makedir->show(); break; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index fb3c52e773..9bf3372e1f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -913,7 +913,7 @@ void EditorNode::_save_scene(String p_file, int idx) { current_option = -1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text("This operation can't be done without a tree root."); + accept->set_text(TTR("This operation can't be done without a tree root.")); accept->popup_centered_minsize(); return; } @@ -1967,7 +1967,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { current_option = -1; //confirmation->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text("This operation can't be done without a tree root."); + accept->set_text(TTR("This operation can't be done without a tree root.")); accept->popup_centered_minsize(); break; } @@ -2073,7 +2073,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { current_option = -1; //confirmation->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text("This operation can't be done without a scene."); + accept->set_text(TTR("This operation can't be done without a scene.")); accept->popup_centered_minsize(); break; } @@ -2118,7 +2118,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { current_option = -1; //accept->get_cancel()->hide(); accept->get_ok()->set_text(TTR("I see..")); - accept->set_text("This operation can't be done without a selected node."); + accept->set_text(TTR("This operation can't be done without a selected node.")); accept->popup_centered_minsize(); break; } @@ -2944,12 +2944,12 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled) String addon_path = "res://addons/" + p_addon + "/plugin.cfg"; Error err = cf->load(addon_path); if (err != OK) { - show_warning("Unable to enable addon plugin at: '" + addon_path + "' parsing of config failed."); + show_warning(TTR("Unable to enable addon plugin at: '") + addon_path + TTR("' parsing of config failed.")); return; } if (!cf->has_section_key("plugin", "script")) { - show_warning("Unable to find script field for addon plugin at: 'res://addons/" + p_addon + "''."); + show_warning(TTR("Unable to find script field for addon plugin at: 'res://addons/") + p_addon + "''."); return; } @@ -2959,18 +2959,18 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled) Ref<Script> script = ResourceLoader::load(path); if (script.is_null()) { - show_warning("Unable to load addon script from path: '" + path + "'."); + show_warning(TTR("Unable to load addon script from path: '") + path + "'."); return; } //could check inheritance.. if (String(script->get_instance_base_type()) != "EditorPlugin") { - show_warning("Unable to load addon script from path: '" + path + "' Base type is not EditorPlugin."); + show_warning(TTR("Unable to load addon script from path: '") + path + "' Base type is not EditorPlugin."); return; } if (!script->is_tool()) { - show_warning("Unable to load addon script from path: '" + path + "' Script is not in tool mode."); + show_warning(TTR("Unable to load addon script from path: '") + path + "' Script is not in tool mode."); return; } @@ -6128,7 +6128,7 @@ EditorNode::EditorNode() { open_imported = memnew(ConfirmationDialog); open_imported->get_ok()->set_text(TTR("Open Anyway")); - new_inherited_button = open_imported->add_button("New Inherited", !OS::get_singleton()->get_swap_ok_cancel(), "inherit"); + new_inherited_button = open_imported->add_button(TTR("New Inherited"), !OS::get_singleton()->get_swap_ok_cancel(), "inherit"); open_imported->connect("confirmed", this, "_open_imported"); open_imported->connect("custom_action", this, "_inherit_imported"); gui_base->add_child(open_imported); @@ -6184,7 +6184,7 @@ EditorNode::EditorNode() { pick_main_scene = memnew(ConfirmationDialog); gui_base->add_child(pick_main_scene); - pick_main_scene->get_ok()->set_text("Select"); + pick_main_scene->get_ok()->set_text(TTR("Select")); pick_main_scene->connect("confirmed", this, "_menu_option", varray(SETTINGS_PICK_MAIN_SCENE)); //Ref<ImageTexture> it = gui_base->get_icon("logo","Icons"); diff --git a/editor/editor_run_native.cpp b/editor/editor_run_native.cpp index 52b7e6992d..8c04ea8f9c 100644 --- a/editor/editor_run_native.cpp +++ b/editor/editor_run_native.cpp @@ -80,7 +80,7 @@ void EditorRunNative::_notification(int p_what) { } else { mb->get_popup()->clear(); mb->show(); - mb->set_tooltip("Select device from the list"); + mb->set_tooltip(TTR("Select device from the list")); for (int i = 0; i < dc; i++) { mb->get_popup()->add_icon_item(get_icon("Play", "EditorIcons"), eep->get_device_name(i)); mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() - 1, eep->get_device_info(i).strip_edges()); @@ -118,7 +118,7 @@ void EditorRunNative::_run_native(int p_idx, int p_platform) { } if (preset.is_null()) { - EditorNode::get_singleton()->show_warning("No runnable export preset found for this platform.\nPlease add a runnable preset in the export menu."); + EditorNode::get_singleton()->show_warning(TTR("No runnable export preset found for this platform.\nPlease add a runnable preset in the export menu.")); return; } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 7413b05aac..889f1e1e3f 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -525,15 +525,15 @@ void FileSystemDock::_update_files(bool p_keep_selection) { type_icon = get_icon("DependencyOk", "EditorIcons"); } else if (E->get().import_status == 2) { type_icon = get_icon("DependencyChanged", "EditorIcons"); - tooltip + "\nStatus: Needs Re-Import"; + tooltip += TTR("\nStatus: Needs Re-Import"); } else if (E->get().import_status == 3) { type_icon = get_icon("ImportFail", "EditorIcons"); - tooltip + "\nStatus: Missing Dependencies"; + tooltip += ("\nStatus: Missing Dependencies"); } if (E->get().sources.size()) { for (int i = 0; i < E->get().sources.size(); i++) { - tooltip += "\nSource: " + E->get().sources[i]; + tooltip += TTR("\nSource: ") + E->get().sources[i]; } } @@ -729,7 +729,7 @@ void FileSystemDock::_rename_operation(const String &p_to_path) { return; } if (FileAccess::exists(p_to_path)) { - EditorNode::get_singleton()->show_warning("Target file exists, can't overwrite. Delete first."); + EditorNode::get_singleton()->show_warning(TTR("Target file exists, can't overwrite. Delete first.")); return; } @@ -818,7 +818,7 @@ void FileSystemDock::_move_operation(const String &p_to_path) { print_line("remapping: " + E->get()); if (err != OK) { - EditorNode::get_singleton()->add_io_error("Can't rename deps for:\n" + E->get() + "\n"); + EditorNode::get_singleton()->add_io_error(TTR("Can't rename deps for:\n") + E->get() + "\n"); } } @@ -832,7 +832,7 @@ void FileSystemDock::_move_operation(const String &p_to_path) { Error err = da->rename(move_files[i], to); print_line("moving file " + move_files[i] + " to " + to); if (err != OK) { - EditorNode::get_singleton()->add_io_error("Error moving file:\n" + move_files[i] + "\n"); + EditorNode::get_singleton()->add_io_error(TTR("Error moving file:\n") + move_files[i] + "\n"); } } @@ -850,7 +850,7 @@ void FileSystemDock::_move_operation(const String &p_to_path) { Error err = da->rename(mdir, to); print_line("moving dir " + mdir + " to " + to); if (err != OK) { - EditorNode::get_singleton()->add_io_error("Error moving dir:\n" + move_dirs[i] + "\n"); + EditorNode::get_singleton()->add_io_error(TTR("Error moving dir:\n") + move_dirs[i] + "\n"); } } @@ -1755,7 +1755,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { scanning_vb = memnew(VBoxContainer); Label *slabel = memnew(Label); - slabel->set_text("Scanning Files,\nPlease Wait.."); + slabel->set_text(TTR("Scanning Files,\nPlease Wait..")); slabel->set_align(Label::ALIGN_CENTER); scanning_vb->add_child(slabel); scanning_progress = memnew(ProgressBar); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index a1fec795f8..43d6c22bcc 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1395,7 +1395,6 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { error_dialog = memnew(ConfirmationDialog); error_dialog->get_ok()->set_text(TTR("Close")); - //error_dialog->get_cancel()->set_text("Close"); error_dialog->set_text(TTR("Error!")); add_child(error_dialog); diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 9d150150a1..f3ff915508 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -285,7 +285,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { AnimationPlayer *ap = Object::cast_to<AnimationPlayer>(anim_tree->get_node(anim_tree->get_master_player())); master_anim_popup->clear(); - master_anim_popup->add_item("Edit Filters"); + master_anim_popup->add_item(TTR("Edit Filters")); master_anim_popup->add_separator(); List<StringName> sn; ap->get_animation_list(&sn); diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp index dd9bd6c34a..09c75b9e87 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -384,7 +384,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { add_child(button_edit); button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); - button_edit->set_tooltip("Edit existing polygon:\nLMB: Move Point.\nCtrl+LMB: Split Segment.\nRMB: Erase Point."); + button_edit->set_tooltip(TTR("Edit existing polygon:\nLMB: Move Point.\nCtrl+LMB: Split Segment.\nRMB: Erase Point.")); //add_constant_override("separation",0); diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp index 14d9f39913..e83cd779c6 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -106,7 +106,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (node->get_occluder_polygon().is_null()) { Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) { - create_poly->set_text("No OccluderPolygon2D resource on this node.\nCreate and assign one?"); + create_poly->set_text(TTR("No OccluderPolygon2D resource on this node.\nCreate and assign one?")); create_poly->popup_centered_minsize(); } return (mb.is_valid() && mb->get_button_index() == 1); diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 076e27c741..98972f8f9e 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -354,7 +354,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); - menu->set_text("Particles"); + menu->set_text(TTR("Particles")); toolbar->add_child(menu); file = memnew(EditorFileDialog); diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp index ef959682c4..4dfae51746 100644 --- a/editor/plugins/particles_editor_plugin.cpp +++ b/editor/plugins/particles_editor_plugin.cpp @@ -389,7 +389,7 @@ ParticlesEditor::ParticlesEditor() { particles_editor_hb->add_child(options); particles_editor_hb->hide(); - options->set_text("Particles"); + options->set_text(TTR("Particles")); options->get_popup()->add_item(TTR("Generate AABB"), MENU_OPTION_GENERATE_AABB); options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Emission Points From Mesh"), MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH); diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp index 001db2cbc5..8a7e869228 100644 --- a/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/editor/plugins/resource_preloader_editor_plugin.cpp @@ -157,7 +157,6 @@ void ResourcePreloaderEditor::_paste_pressed() { if (!r.is_valid()) { dialog->set_text(TTR("Resource clipboard is empty!")); dialog->set_title(TTR("Error!")); - //dialog->get_cancel()->set_text("Close"); dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 5b0891e0cd..a6db0f6e59 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -602,7 +602,7 @@ void ScriptEditor::_close_all_tabs() { } void ScriptEditor::_ask_close_current_unsaved_tab(ScriptEditorBase *current) { - erase_tab_confirm->set_text("Close and save changes?\n\"" + current->get_name() + "\""); + erase_tab_confirm->set_text(TTR("Close and save changes?\n\"") + current->get_name() + "\""); erase_tab_confirm->popup_centered_minsize(); } @@ -1568,7 +1568,7 @@ void ScriptEditor::_update_script_names() { String name = eh->get_class(); Ref<Texture> icon = get_icon("Help", "EditorIcons"); - String tooltip = name + " Class Reference"; + String tooltip = name + TTR(" Class Reference"); _ScriptEditorItemData sd; sd.icon = icon; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index e86ff8cac2..d3bfbf17fc 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1230,7 +1230,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data } if (res->get_path().is_resource_file()) { - EditorNode::get_singleton()->show_warning("Only resources from filesystem can be dropped."); + EditorNode::get_singleton()->show_warning(TTR("Only resources from filesystem can be dropped.")); return; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index c4e4050539..b269f29036 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2483,7 +2483,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed preview_camera->set_toggle_mode(true); preview_camera->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE); preview_camera->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE); - preview_camera->set_text("preview"); + preview_camera->set_text(TTR("preview")); surface->add_child(preview_camera); preview_camera->hide(); preview_camera->connect("toggled", this, "_toggle_camera_preview"); @@ -3829,7 +3829,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SELECT]->set_pressed(true); button_binds[0] = MENU_TOOL_SELECT; tool_button[TOOL_MODE_SELECT]->connect("pressed", this, "_menu_item_pressed", button_binds); - tool_button[TOOL_MODE_SELECT]->set_tooltip("Select Mode (Q)\n" + keycode_get_string(KEY_MASK_CMD) + "Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection"); + tool_button[TOOL_MODE_SELECT]->set_tooltip(TTR("Select Mode (Q)\n") + keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection")); tool_button[TOOL_MODE_MOVE] = memnew(ToolButton); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index d9e310a586..6406655231 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -280,7 +280,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { rect.expand_to(r.position); rect.expand_to(r.position + r.size); } - undo_redo->create_action("Set Region Rect"); + undo_redo->create_action(TTR("Set Region Rect")); if (node_sprite) { undo_redo->add_do_method(node_sprite, "set_region_rect", rect); undo_redo->add_undo_method(node_sprite, "set_region_rect", node_sprite->get_region_rect()); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 9cf43e6564..c55bc46b25 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -529,8 +529,8 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { } else if (p_option == POPUP_CLASS_REMOVE) { - add_del_dialog->set_title("Remove All Items"); - add_del_dialog->get_ok()->set_text("Remove All"); + add_del_dialog->set_title(TTR("Remove All Items")); + add_del_dialog->get_ok()->set_text(TTR("Remove All")); add_del_dialog->popup_centered(Size2(240, 85) * EDSCALE); base_theme = Theme::get_default(); diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index d89fe43ed2..6749f24204 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -106,7 +106,7 @@ void TileMapEditor::_menu_option(int p_option) { if (!selection_active) return; - undo_redo->create_action("Erase Selection"); + undo_redo->create_action(TTR("Erase Selection")); for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) { for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) { @@ -730,7 +730,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (id != TileMap::INVALID_CELL) { - undo_redo->create_action("Line Draw"); + undo_redo->create_action(TTR("Line Draw")); for (Map<Point2i, CellOp>::Element *E = paint_undo.front(); E; E = E->next()) { _set_cell(E->key(), id, flip_h, flip_v, transpose, true); @@ -747,7 +747,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (id != TileMap::INVALID_CELL) { - undo_redo->create_action("Rectangle Paint"); + undo_redo->create_action(TTR("Rectangle Paint")); for (int i = rectangle.position.y; i <= rectangle.position.y + rectangle.size.y; i++) { for (int j = rectangle.position.x; j <= rectangle.position.x + rectangle.size.x; j++) { @@ -796,7 +796,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { op["flip_v"] = flip_v; op["transpose"] = transpose; - undo_redo->create_action("Bucket Fill"); + undo_redo->create_action(TTR("Bucket Fill")); undo_redo->add_do_method(this, "_fill_points", points, op); undo_redo->add_undo_method(this, "_fill_points", points, pop); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index b9694dffcb..a600c8af2a 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -913,8 +913,8 @@ ProjectExportDialog::ProjectExportDialog() { updating = false; - get_ok()->set_text("Export PCK/Zip"); - export_button = add_button("Export Project", !OS::get_singleton()->get_swap_ok_cancel(), "export"); + get_ok()->set_text(TTR("Export PCK/Zip")); + export_button = add_button(TTR("Export Project"), !OS::get_singleton()->get_swap_ok_cancel(), "export"); export_pck_zip = memnew(FileDialog); export_pck_zip->add_filter("*.zip ; ZIP File"); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c847807398..0d57fe05b9 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -218,7 +218,7 @@ private: unzFile pkg = unzOpen2(zip_path.utf8().get_data(), &io); if (!pkg) { - dialog_error->set_text("Error opening package file, not in zip format."); + dialog_error->set_text(TTR("Error opening package file, not in zip format.")); return; } @@ -1389,9 +1389,6 @@ ProjectManager::ProjectManager() { _scan_begin(EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path")); } - //get_ok()->set_text("Open"); - //get_ok()->set_text("Exit"); - last_clicked = ""; SceneTree::get_singleton()->connect("files_dropped", this, "_files_dropped"); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index c221a551ba..5a30522d7c 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -763,7 +763,7 @@ void ProjectSettingsEditor::_item_add() { String name = catname != "" ? catname + "/" + propname : propname; - undo_redo->create_action("Add Global Property"); + undo_redo->create_action(TTR("Add Global Property")); undo_redo->add_do_property(ProjectSettings::get_singleton(), name, value); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index d5d0de5372..f175e4c8e4 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1125,7 +1125,7 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { Node *to_node = get_node(p_path); if (!Object::cast_to<Viewport>(to_node)) { - EditorNode::get_singleton()->show_warning("Selected node is not a Viewport!"); + EditorNode::get_singleton()->show_warning(TTR("Selected node is not a Viewport!")); return; } diff --git a/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp index dfb152d40b..5892e530be 100644 --- a/editor/run_settings_dialog.cpp +++ b/editor/run_settings_dialog.cpp @@ -86,7 +86,6 @@ RunSettingsDialog::RunSettingsDialog() { arguments->set_editable(false); get_ok()->set_text(TTR("Close")); - //get_cancel()->set_text("Close"); set_title(TTR("Scene Run Settings")); } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 62bc7e8bec..c3eb7240d4 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -707,7 +707,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { ERR_FAIL_COND(node->get_filename() == String()); - undo_redo->create_action("Discard Instancing"); + undo_redo->create_action(TTR("Discard Instancing")); undo_redo->add_do_method(node, "set_filename", ""); undo_redo->add_undo_method(node, "set_filename", node->get_filename()); _node_replace_owner(node, node, root); diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index a09e1cbda0..3e56e74808 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -1004,7 +1004,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label, bool p_can_rename, bool p_can_ope warning = memnew(AcceptDialog); add_child(warning); - warning->set_title("Node Configuration Warning!"); + warning->set_title(TTR("Node Configuration Warning!")); show_enabled_subscene = false; diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 8c56da4492..75610fc005 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -403,7 +403,7 @@ void GridMapEditor::_delete_selection() { if (!selection.active) return; - undo_redo->create_action("GridMap Delete Selection"); + undo_redo->create_action(TTR("GridMap Delete Selection")); for (int i = selection.begin.x; i <= selection.end.x; i++) { for (int j = selection.begin.y; j <= selection.end.y; j++) { @@ -487,7 +487,7 @@ void GridMapEditor::_duplicate_paste() { Vector3 ofs = selection.current - selection.click; if (items.size()) { - undo_redo->create_action("GridMap Duplicate Selection"); + undo_redo->create_action(TTR("GridMap Duplicate Selection")); for (List<__Item>::Element *E = items.front(); E; E = E->next()) { __Item &it = E->get(); Vector3 pos = it.pos + ofs; @@ -568,7 +568,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu (mb->get_button_index() == BUTTON_LEFT && input_action == INPUT_PAINT)) { if (set_items.size()) { - undo_redo->create_action("GridMap Paint"); + undo_redo->create_action(TTR("GridMap Paint")); for (List<SetItem>::Element *E = set_items.front(); E; E = E->next()) { const SetItem &si = E->get(); @@ -1142,45 +1142,45 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { spatial_editor_hb->hide(); options->set_text("Grid"); - options->get_popup()->add_check_item("Snap View", MENU_OPTION_LOCK_VIEW); + options->get_popup()->add_check_item(TTR("Snap View"), MENU_OPTION_LOCK_VIEW); options->get_popup()->add_separator(); - options->get_popup()->add_item("Prev Level (" + keycode_get_string(KEY_MASK_CMD) + "Down Wheel)", MENU_OPTION_PREV_LEVEL); - options->get_popup()->add_item("Next Level (" + keycode_get_string(KEY_MASK_CMD) + "Up Wheel)", MENU_OPTION_NEXT_LEVEL); + options->get_popup()->add_item(TTR("Prev Level (") + keycode_get_string(KEY_MASK_CMD) + TTR("Down Wheel)"), MENU_OPTION_PREV_LEVEL); + options->get_popup()->add_item(TTR("Next Level (") + keycode_get_string(KEY_MASK_CMD) + TTR("Up Wheel)"), MENU_OPTION_NEXT_LEVEL); options->get_popup()->add_separator(); - options->get_popup()->add_check_item("Clip Disabled", MENU_OPTION_CLIP_DISABLED); + options->get_popup()->add_check_item(TTR("Clip Disabled"), MENU_OPTION_CLIP_DISABLED); options->get_popup()->set_item_checked(options->get_popup()->get_item_index(MENU_OPTION_CLIP_DISABLED), true); - options->get_popup()->add_check_item("Clip Above", MENU_OPTION_CLIP_ABOVE); - options->get_popup()->add_check_item("Clip Below", MENU_OPTION_CLIP_BELOW); + options->get_popup()->add_check_item(TTR("Clip Above"), MENU_OPTION_CLIP_ABOVE); + options->get_popup()->add_check_item(TTR("Clip Below"), MENU_OPTION_CLIP_BELOW); options->get_popup()->add_separator(); - options->get_popup()->add_check_item("Edit X Axis", MENU_OPTION_X_AXIS, KEY_Z); - options->get_popup()->add_check_item("Edit Y Axis", MENU_OPTION_Y_AXIS, KEY_X); - options->get_popup()->add_check_item("Edit Z Axis", MENU_OPTION_Z_AXIS, KEY_C); + options->get_popup()->add_check_item(TTR("Edit X Axis"), MENU_OPTION_X_AXIS, KEY_Z); + options->get_popup()->add_check_item(TTR("Edit Y Axis"), MENU_OPTION_Y_AXIS, KEY_X); + options->get_popup()->add_check_item(TTR("Edit Z Axis"), MENU_OPTION_Z_AXIS, KEY_C); options->get_popup()->set_item_checked(options->get_popup()->get_item_index(MENU_OPTION_Y_AXIS), true); options->get_popup()->add_separator(); - options->get_popup()->add_item("Cursor Rotate X", MENU_OPTION_CURSOR_ROTATE_X, KEY_A); - options->get_popup()->add_item("Cursor Rotate Y", MENU_OPTION_CURSOR_ROTATE_Y, KEY_S); - options->get_popup()->add_item("Cursor Rotate Z", MENU_OPTION_CURSOR_ROTATE_Z, KEY_D); - options->get_popup()->add_item("Cursor Back Rotate X", MENU_OPTION_CURSOR_BACK_ROTATE_X, KEY_MASK_SHIFT + KEY_A); - options->get_popup()->add_item("Cursor Back Rotate Y", MENU_OPTION_CURSOR_BACK_ROTATE_Y, KEY_MASK_SHIFT + KEY_S); - options->get_popup()->add_item("Cursor Back Rotate Z", MENU_OPTION_CURSOR_BACK_ROTATE_Z, KEY_MASK_SHIFT + KEY_D); - options->get_popup()->add_item("Cursor Clear Rotation", MENU_OPTION_CURSOR_CLEAR_ROTATION, KEY_W); + options->get_popup()->add_item(TTR("Cursor Rotate X"), MENU_OPTION_CURSOR_ROTATE_X, KEY_A); + options->get_popup()->add_item(TTR("Cursor Rotate Y"), MENU_OPTION_CURSOR_ROTATE_Y, KEY_S); + options->get_popup()->add_item(TTR("Cursor Rotate Z"), MENU_OPTION_CURSOR_ROTATE_Z, KEY_D); + options->get_popup()->add_item(TTR("Cursor Back Rotate X"), MENU_OPTION_CURSOR_BACK_ROTATE_X, KEY_MASK_SHIFT + KEY_A); + options->get_popup()->add_item(TTR("Cursor Back Rotate Y"), MENU_OPTION_CURSOR_BACK_ROTATE_Y, KEY_MASK_SHIFT + KEY_S); + options->get_popup()->add_item(TTR("Cursor Back Rotate Z"), MENU_OPTION_CURSOR_BACK_ROTATE_Z, KEY_MASK_SHIFT + KEY_D); + options->get_popup()->add_item(TTR("Cursor Clear Rotation"), MENU_OPTION_CURSOR_CLEAR_ROTATION, KEY_W); options->get_popup()->add_separator(); options->get_popup()->add_check_item("Duplicate Selects", MENU_OPTION_DUPLICATE_SELECTS); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Area", MENU_OPTION_SELECTION_MAKE_AREA, KEY_CONTROL + KEY_C); - options->get_popup()->add_item("Create Exterior Connector", MENU_OPTION_SELECTION_MAKE_EXTERIOR_CONNECTOR); - options->get_popup()->add_item("Erase Area", MENU_OPTION_REMOVE_AREA); + options->get_popup()->add_item(TTR("Create Area"), MENU_OPTION_SELECTION_MAKE_AREA, KEY_CONTROL + KEY_C); + options->get_popup()->add_item(TTR("Create Exterior Connector"), MENU_OPTION_SELECTION_MAKE_EXTERIOR_CONNECTOR); + options->get_popup()->add_item(TTR("Erase Area"), MENU_OPTION_REMOVE_AREA); options->get_popup()->add_separator(); - options->get_popup()->add_item("Selection -> Duplicate", MENU_OPTION_SELECTION_DUPLICATE, KEY_MASK_SHIFT + KEY_INSERT); - options->get_popup()->add_item("Selection -> Clear", MENU_OPTION_SELECTION_CLEAR, KEY_MASK_SHIFT + KEY_DELETE); + options->get_popup()->add_item(TTR("Selection -> Duplicate"), MENU_OPTION_SELECTION_DUPLICATE, KEY_MASK_SHIFT + KEY_INSERT); + options->get_popup()->add_item(TTR("Selection -> Clear"), MENU_OPTION_SELECTION_CLEAR, KEY_MASK_SHIFT + KEY_DELETE); //options->get_popup()->add_separator(); //options->get_popup()->add_item("Configure",MENU_OPTION_CONFIGURE); options->get_popup()->add_separator(); - options->get_popup()->add_item("Settings", MENU_OPTION_GRIDMAP_SETTINGS); + options->get_popup()->add_item(TTR("Settings"), MENU_OPTION_GRIDMAP_SETTINGS); settings_dialog = memnew(ConfirmationDialog); - settings_dialog->set_title("GridMap Settings"); + settings_dialog->set_title(TTR("GridMap Settings")); add_child(settings_dialog); settings_vbc = memnew(VBoxContainer); settings_vbc->set_custom_minimum_size(Size2(200, 0)); @@ -1191,7 +1191,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { settings_pick_distance->set_min(500.0f); settings_pick_distance->set_step(1.0f); settings_pick_distance->set_value(EDITOR_DEF("editors/grid_map/pick_distance", 5000.0)); - settings_vbc->add_margin_child("Pick Distance:", settings_pick_distance); + settings_vbc->add_margin_child(TTR("Pick Distance:"), settings_pick_distance); clip_mode = CLIP_DISABLED; options->get_popup()->connect("id_pressed", this, "_menu_option"); @@ -1204,8 +1204,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { edit_mode->set_area_as_parent_rect(); edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24); edit_mode->set_margin(MARGIN_RIGHT, -14); - edit_mode->add_item("Tiles"); - edit_mode->add_item("Areas"); + edit_mode->add_item(TTR("Tiles")); + edit_mode->add_item(TTR("Areas")); hb->add_child(edit_mode); edit_mode->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 61c21227fa..e93d6ec4d1 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -73,7 +73,7 @@ protected: if (argc == new_argc) return true; - undo_redo->create_action("Change Signal Arguments"); + undo_redo->create_action(TTR("Change Signal Arguments")); if (new_argc < argc) { for (int i = new_argc; i < argc; i++) { @@ -104,7 +104,7 @@ protected: int old_type = script->custom_signal_get_argument_type(sig, idx); int new_type = p_value; - undo_redo->create_action("Change Argument Type"); + undo_redo->create_action(TTR("Change Argument Type")); undo_redo->add_do_method(script.ptr(), "custom_signal_set_argument_type", sig, idx, new_type); undo_redo->add_undo_method(script.ptr(), "custom_signal_set_argument_type", sig, idx, old_type); undo_redo->commit_action(); @@ -116,7 +116,7 @@ protected: String old_name = script->custom_signal_get_argument_name(sig, idx); String new_name = p_value; - undo_redo->create_action("Change Argument name"); + undo_redo->create_action(TTR("Change Argument name")); undo_redo->add_do_method(script.ptr(), "custom_signal_set_argument_name", sig, idx, new_name); undo_redo->add_undo_method(script.ptr(), "custom_signal_set_argument_name", sig, idx, old_name); undo_redo->commit_action(); @@ -213,7 +213,7 @@ protected: return false; if (String(p_name) == "value") { - undo_redo->create_action("Set Variable Default Value"); + undo_redo->create_action(TTR("Set Variable Default Value")); Variant current = script->get_variable_default_value(var); undo_redo->add_do_method(script.ptr(), "set_variable_default_value", var, p_value); undo_redo->add_undo_method(script.ptr(), "set_variable_default_value", var, current); @@ -229,7 +229,7 @@ protected: Dictionary dc = d.copy(); dc["type"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -242,7 +242,7 @@ protected: Dictionary dc = d.copy(); dc["hint"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -255,7 +255,7 @@ protected: Dictionary dc = d.copy(); dc["hint_string"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -1264,7 +1264,7 @@ void VisualScriptEditor::_on_nodes_delete() { if (to_erase.empty()) return; - undo_redo->create_action("Remove VisualScript Nodes"); + undo_redo->create_action(TTR("Remove VisualScript Nodes")); for (List<int>::Element *F = to_erase.front(); F; F = F->next()) { @@ -1313,7 +1313,7 @@ void VisualScriptEditor::_on_nodes_duplicate() { if (to_duplicate.empty()) return; - undo_redo->create_action("Duplicate VisualScript Nodes"); + undo_redo->create_action(TTR("Duplicate VisualScript Nodes")); int idc = script->get_available_id() + 1; Set<int> to_select; @@ -2208,7 +2208,7 @@ void VisualScriptEditor::_change_base_type_callback() { String bt = select_base_type->get_selected_type(); ERR_FAIL_COND(bt == String()); - undo_redo->create_action("Change Base Type"); + undo_redo->create_action(TTR("Change Base Type")); undo_redo->add_do_method(script.ptr(), "set_instance_base_type", bt); undo_redo->add_undo_method(script.ptr(), "set_instance_base_type", script->get_instance_base_type()); undo_redo->add_do_method(this, "_update_members"); @@ -2256,7 +2256,7 @@ static bool _get_in_slot(const Ref<VisualScriptNode> &p_node, int p_slot, int &r void VisualScriptEditor::_begin_node_move() { - undo_redo->create_action("Move Node(s)"); + undo_redo->create_action(TTR("Move Node(s)")); } void VisualScriptEditor::_end_node_move() { @@ -2282,7 +2282,7 @@ void VisualScriptEditor::_node_moved(Vector2 p_from, Vector2 p_to, int p_id) { void VisualScriptEditor::_remove_node(int p_id) { - undo_redo->create_action("Remove VisualScript Node"); + undo_redo->create_action(TTR("Remove VisualScript Node")); undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, p_id); undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_pos(edited_func, p_id)); @@ -2343,7 +2343,7 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot, ERR_FAIL_COND(from_seq != to_seq); - undo_redo->create_action("Connect Nodes"); + undo_redo->create_action(TTR("Connect Nodes")); if (from_seq) { undo_redo->add_do_method(script.ptr(), "sequence_connect", edited_func, p_from.to_int(), from_port, p_to.to_int()); @@ -2396,7 +2396,7 @@ void VisualScriptEditor::_graph_disconnected(const String &p_from, int p_from_sl ERR_FAIL_COND(from_seq != to_seq); - undo_redo->create_action("Connect Nodes"); + undo_redo->create_action(TTR("Connect Nodes")); if (from_seq) { undo_redo->add_do_method(script.ptr(), "sequence_disconnect", edited_func, p_from.to_int(), from_port, p_to.to_int()); @@ -2723,7 +2723,7 @@ void VisualScriptEditor::_default_value_changed() { if (vsn.is_null()) return; - undo_redo->create_action("Change Input Value"); + undo_redo->create_action(TTR("Change Input Value")); undo_redo->add_do_method(vsn.ptr(), "set_default_input_value", editing_input, default_value_edit->get_variant()); undo_redo->add_undo_method(vsn.ptr(), "set_default_input_value", editing_input, vsn->get_default_input_value(editing_input)); @@ -2886,7 +2886,7 @@ void VisualScriptEditor::_menu_option(int p_what) { int id = String(gn->get_name()).to_int(); Ref<VisualScriptNode> node = script->get_node(edited_func, id); if (Object::cast_to<VisualScriptFunction>(*node)) { - EditorNode::get_singleton()->show_warning("Can't copy the function node."); + EditorNode::get_singleton()->show_warning(TTR("Can't copy the function node.")); return; } if (node.is_valid()) { @@ -2934,13 +2934,13 @@ void VisualScriptEditor::_menu_option(int p_what) { break; if (clipboard->nodes.empty()) { - EditorNode::get_singleton()->show_warning("Clipboard is empty!"); + EditorNode::get_singleton()->show_warning(TTR("Clipboard is empty!")); break; } Map<int, int> remap; - undo_redo->create_action("Paste VisualScript Nodes"); + undo_redo->create_action(TTR("Paste VisualScript Nodes")); int idc = script->get_available_id() + 1; Set<int> to_select; |