diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-05-03 22:25:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-05-03 22:25:37 -0300 |
commit | 567cb691ec49844101247bb9dc34bc2722f6af4f (patch) | |
tree | caa577fdc22feec8869e66b32be34db0c90f8aa8 /tools/editor/plugins | |
parent | c7e8def44696da9ddf0b459e166280668c84c4cb (diff) |
Modified editor strings to be translatable in the future
Diffstat (limited to 'tools/editor/plugins')
43 files changed, 847 insertions, 848 deletions
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index da7c083c5a..745266e19a 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -144,7 +144,7 @@ void AnimationPlayerEditor::_autoplay_pressed() { String current = animation->get_item_text( animation->get_selected() ); if (player->get_autoplay()==current) { //unset - undo_redo->create_action("Toggle Autoplay"); + undo_redo->create_action(TTR("Toggle Autoplay")); undo_redo->add_do_method(player,"set_autoplay",""); undo_redo->add_undo_method(player,"set_autoplay",player->get_autoplay()); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -154,7 +154,7 @@ void AnimationPlayerEditor::_autoplay_pressed() { } else { //set - undo_redo->create_action("Toggle Autoplay"); + undo_redo->create_action(TTR("Toggle Autoplay")); undo_redo->add_do_method(player,"set_autoplay",current); undo_redo->add_undo_method(player,"set_autoplay",player->get_autoplay()); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -317,10 +317,10 @@ void AnimationPlayerEditor::_animation_selected(int p_which) { void AnimationPlayerEditor::_animation_new() { renaming=false; - name_title->set_text("New Animation Name:"); + name_title->set_text(TTR("New Animation Name:")); int count=1; - String base="New Anim"; + String base=TTR("New Anim"); while(true) { String attempt = base; if (count>1) @@ -345,7 +345,7 @@ void AnimationPlayerEditor::_animation_rename() { int selected = animation->get_selected(); String selected_name = animation->get_item_text(selected); - name_title->set_text("Change Animation Name:"); + name_title->set_text(TTR("Change Animation Name:")); name->set_text(selected_name); renaming=true; name_dialog->popup_centered(Size2(300,90)); @@ -383,7 +383,7 @@ void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resou Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err != OK) { - accept->set_text("Error saving resource!"); + accept->set_text(TTR("Error saving resource!")); accept->popup_centered_minsize(); return; } @@ -437,7 +437,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource) } file->popup_centered_ratio(); - file->set_title("Save Resource As.."); + file->set_title(TTR("Save Resource As..")); current_option = RESOURCE_SAVE; } void AnimationPlayerEditor::_animation_remove() { @@ -449,7 +449,7 @@ void AnimationPlayerEditor::_animation_remove() { Ref<Animation> anim = player->get_animation(current); - undo_redo->create_action("Remove Animation"); + undo_redo->create_action(TTR("Remove Animation")); undo_redo->add_do_method(player,"remove_animation",current); undo_redo->add_undo_method(player,"add_animation",current,anim); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -485,7 +485,7 @@ void AnimationPlayerEditor::_animation_name_edited() { String new_name = name->get_text(); if (new_name=="" || new_name.find(":")!=-1 || new_name.find("/")!=-1) { - error_dialog->set_text("ERROR: Invalid animation name!"); + error_dialog->set_text(TTR("ERROR: Invalid animation name!")); error_dialog->popup_centered_minsize(); return; } @@ -496,7 +496,7 @@ void AnimationPlayerEditor::_animation_name_edited() { } if (player->has_animation(new_name)) { - error_dialog->set_text("ERROR: Animation Name Already Exists!"); + error_dialog->set_text(TTR("ERROR: Animation Name Already Exists!")); error_dialog->popup_centered_minsize(); return; } @@ -505,7 +505,7 @@ void AnimationPlayerEditor::_animation_name_edited() { String current = animation->get_item_text(animation->get_selected()); Ref<Animation> anim = player->get_animation(current); - undo_redo->create_action("Rename Animation"); + undo_redo->create_action(TTR("Rename Animation")); undo_redo->add_do_method(player,"rename_animation",current,new_name); undo_redo->add_do_method(anim.ptr(),"set_name",new_name); undo_redo->add_undo_method(player,"rename_animation",new_name,current); @@ -521,7 +521,7 @@ void AnimationPlayerEditor::_animation_name_edited() { Ref<Animation> new_anim = Ref<Animation>(memnew( Animation )); new_anim->set_name(new_name); - undo_redo->create_action("Add Animation"); + undo_redo->create_action(TTR("Add Animation")); undo_redo->add_do_method(player,"add_animation",new_name,new_anim); undo_redo->add_undo_method(player,"remove_animation",new_name); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -605,7 +605,7 @@ void AnimationPlayerEditor::_blend_edited() { float blend_time = selected->get_range(1); float prev_blend_time = player->get_blend_time(current,to); - undo_redo->create_action("Change Blend Time"); + undo_redo->create_action(TTR("Change Blend Time")); undo_redo->add_do_method(player,"set_blend_time",current,to,blend_time); undo_redo->add_undo_method(player,"set_blend_time",current,to,prev_blend_time); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -717,7 +717,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) { if (p_file.find(".") != -1) p_file = p_file.substr(0, p_file.find(".")); - undo_redo->create_action("Load Animation"); + undo_redo->create_action(TTR("Load Animation")); undo_redo->add_do_method(player, "add_animation", p_file, res); undo_redo->add_undo_method(player, "remove_animation", p_file); if (player->has_animation(p_file)) { @@ -910,7 +910,7 @@ void AnimationPlayerEditor::_animation_duplicate() { } - undo_redo->create_action("Duplicate Animation"); + undo_redo->create_action(TTR("Duplicate Animation")); undo_redo->add_do_method(player,"add_animation",new_name,new_anim); undo_redo->add_undo_method(player,"remove_animation",new_name); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -1000,7 +1000,7 @@ void AnimationPlayerEditor::_editor_store() { return; //already there - undo_redo->create_action("Store anim in editor"); + undo_redo->create_action(TTR("Store anim in editor")); undo_redo->add_do_method(key_editor,"set_animation",anim); undo_redo->add_undo_method(key_editor,"remove_animation",anim); undo_redo->commit_action(); @@ -1022,7 +1022,7 @@ void AnimationPlayerEditor::_editor_load(){ String base=anim->get_name(); bool noname=false; if (base=="") { - base="New Anim"; + base=TTR("New Anim"); noname=true; } @@ -1041,7 +1041,7 @@ void AnimationPlayerEditor::_editor_load(){ if (noname) anim->set_name(base); - undo_redo->create_action("Add Animation From Editor"); + undo_redo->create_action(TTR("Add Animation From Editor")); undo_redo->add_do_method(player,"add_animation",base,anim); undo_redo->add_undo_method(player,"remove_animation",base); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -1108,7 +1108,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { case TOOL_COPY_ANIM: { if (!animation->get_item_count()) { - error_dialog->set_text("ERROR: No animation to copy!"); + error_dialog->set_text(TTR("ERROR: No animation to copy!")); error_dialog->popup_centered_minsize(); return; } @@ -1123,14 +1123,14 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { Ref<Animation> anim = EditorSettings::get_singleton()->get_resource_clipboard(); if (!anim.is_valid()) { - error_dialog->set_text("ERROR: No animation resource on clipboard!"); + error_dialog->set_text(TTR("ERROR: No animation resource on clipboard!")); error_dialog->popup_centered_minsize(); return; } String name = anim->get_name(); if (name=="") { - name="Pasted Animation"; + name=TTR("Pasted Animation"); } int idx=1; @@ -1141,7 +1141,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { name=base+" "+itos(idx); } - undo_redo->create_action("Paste Animation"); + undo_redo->create_action(TTR("Paste Animation")); undo_redo->add_do_method(player,"add_animation",name,anim); undo_redo->add_undo_method(player,"remove_animation",name); undo_redo->add_do_method(this,"_animation_player_changed",player); @@ -1155,7 +1155,7 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { case TOOL_EDIT_RESOURCE: { if (!animation->get_item_count()) { - error_dialog->set_text("ERROR: No animation to edit!"); + error_dialog->set_text(TTR("ERROR: No animation to edit!")); error_dialog->popup_centered_minsize(); return; } @@ -1276,7 +1276,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { Label * l; /*l= memnew( Label ); - l->set_text("Animation Player:"); + l->set_text(TTR("Animation Player:")); add_child(l);*/ HBoxContainer *hb = memnew( HBoxContainer ); @@ -1284,25 +1284,25 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { play_bw_from = memnew( ToolButton ); - play_bw_from->set_tooltip("Play backwards selected animation from current pos. (A)"); + play_bw_from->set_tooltip(TTR("Play backwards selected animation from current pos. (A)")); hb->add_child(play_bw_from); play_bw = memnew( ToolButton ); - play_bw->set_tooltip("Play backwards selected animation from end. (Shift+A)"); + play_bw->set_tooltip(TTR("Play backwards selected animation from end. (Shift+A)")); hb->add_child(play_bw); stop = memnew( ToolButton ); stop->set_toggle_mode(true); hb->add_child(stop); - stop->set_tooltip("Stop animation playback. (S)"); + stop->set_tooltip(TTR("Stop animation playback. (S)")); play = memnew( ToolButton ); - play->set_tooltip("Play selected animation from start. (Shift+D)"); + play->set_tooltip(TTR("Play selected animation from start. (Shift+D)")); hb->add_child(play); play_from = memnew( ToolButton ); - play_from->set_tooltip("Play selected animation from current pos. (D)"); + play_from->set_tooltip(TTR("Play selected animation from current pos. (D)")); hb->add_child(play_from); @@ -1315,7 +1315,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { hb->add_child(frame); frame->set_custom_minimum_size(Size2(60,0)); frame->set_stretch_ratio(2); - frame->set_tooltip("Animation position (in seconds)."); + frame->set_tooltip(TTR("Animation position (in seconds).")); hb->add_child( memnew( VSeparator)); @@ -1323,24 +1323,24 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { hb->add_child(scale); scale->set_h_size_flags(SIZE_EXPAND_FILL); scale->set_stretch_ratio(1); - scale->set_tooltip("Scale animation playback globally for the node."); + scale->set_tooltip(TTR("Scale animation playback globally for the node.")); scale->hide(); add_anim = memnew( ToolButton ); - add_anim->set_tooltip("Create new animation in player."); + add_anim->set_tooltip(TTR("Create new animation in player.")); hb->add_child(add_anim); load_anim = memnew( ToolButton ); - load_anim->set_tooltip("Load an animation from disk."); + load_anim->set_tooltip(TTR("Load an animation from disk.")); hb->add_child(load_anim); save_anim = memnew(MenuButton); - save_anim->set_tooltip("Save the current animation"); - save_anim->get_popup()->add_item("Save", ANIM_SAVE); - save_anim->get_popup()->add_item("Save As..", ANIM_SAVE_AS); + save_anim->set_tooltip(TTR("Save the current animation")); + save_anim->get_popup()->add_item(TTR("Save"), ANIM_SAVE); + save_anim->get_popup()->add_item(TTR("Save As.."), ANIM_SAVE_AS); save_anim->set_focus_mode(Control::FOCUS_NONE); hb->add_child(save_anim); @@ -1350,40 +1350,40 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { duplicate_anim = memnew( ToolButton ); hb->add_child(duplicate_anim); - duplicate_anim->set_tooltip("Duplicate Animation"); + duplicate_anim->set_tooltip(TTR("Duplicate Animation")); rename_anim = memnew( ToolButton ); hb->add_child(rename_anim); - rename_anim->set_tooltip("Rename Animation"); + rename_anim->set_tooltip(TTR("Rename Animation")); remove_anim = memnew( ToolButton ); hb->add_child(remove_anim); - remove_anim->set_tooltip("Remove Animation"); + remove_anim->set_tooltip(TTR("Remove Animation")); animation = memnew( OptionButton ); hb->add_child(animation); animation->set_h_size_flags(SIZE_EXPAND_FILL); - animation->set_tooltip("Display list of animations in player."); + animation->set_tooltip(TTR("Display list of animations in player.")); autoplay = memnew( ToolButton ); hb->add_child(autoplay); - autoplay->set_tooltip("Autoplay On Load"); + autoplay->set_tooltip(TTR("Autoplay On Load")); blend_anim = memnew( ToolButton ); hb->add_child(blend_anim); - blend_anim->set_tooltip("Edit Target Blend Times"); + blend_anim->set_tooltip(TTR("Edit Target Blend Times")); tool_anim = memnew( MenuButton); //tool_anim->set_flat(false); - tool_anim->set_tooltip("Animation Tools"); - tool_anim->get_popup()->add_item("Copy Animation",TOOL_COPY_ANIM); - tool_anim->get_popup()->add_item("Paste Animation",TOOL_PASTE_ANIM); + tool_anim->set_tooltip(TTR("Animation Tools")); + tool_anim->get_popup()->add_item(TTR("Copy Animation"),TOOL_COPY_ANIM); + tool_anim->get_popup()->add_item(TTR("Paste Animation"),TOOL_PASTE_ANIM); //tool_anim->get_popup()->add_separator(); - //tool_anim->get_popup()->add_item("Edit Anim Resource",TOOL_PASTE_ANIM); + //tool_anim->get_popup()->add_item(TTR("Edit Anim Resource"),TOOL_PASTE_ANIM); hb->add_child(tool_anim); nodename = memnew( Button ); @@ -1403,7 +1403,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { add_child(file); name_dialog = memnew( ConfirmationDialog ); - name_dialog->set_title("Create New Animation"); + name_dialog->set_title(TTR("Create New Animation")); name_dialog->set_hide_on_ok(false); add_child(name_dialog); name = memnew( LineEdit ); @@ -1414,33 +1414,33 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { l = memnew( Label ); - l->set_text("Animation Name:"); + l->set_text(TTR("Animation Name:")); l->set_pos( Point2(10,10) ); name_dialog->add_child(l); name_title=l; error_dialog = memnew( ConfirmationDialog ); - error_dialog->get_ok()->set_text("Close"); - //error_dialog->get_cancel()->set_text("Close"); - error_dialog->set_text("Error!"); + error_dialog->get_ok()->set_text(TTR("Close")); + //error_dialog->get_cancel()->set_text(TTR("Close")); + error_dialog->set_text(TTR("Error!")); add_child(error_dialog); name_dialog->connect("confirmed", this,"_animation_name_edited"); blend_editor.dialog = memnew( AcceptDialog ); add_child(blend_editor.dialog); - blend_editor.dialog->get_ok()->set_text("Close"); + blend_editor.dialog->get_ok()->set_text(TTR("Close")); blend_editor.dialog->set_hide_on_ok(true); VBoxContainer *blend_vb = memnew( VBoxContainer); blend_editor.dialog->add_child(blend_vb); blend_editor.dialog->set_child_rect(blend_vb); blend_editor.tree = memnew( Tree ); blend_editor.tree->set_columns(2); - blend_vb->add_margin_child("Blend Times: ",blend_editor.tree,true); + blend_vb->add_margin_child(TTR("Blend Times: "),blend_editor.tree,true); blend_editor.next = memnew( LineEdit ); - blend_vb->add_margin_child("Next (Auto Queue):",blend_editor.next); - blend_editor.dialog->set_title("Cross-Animation Blend Times"); + blend_vb->add_margin_child(TTR("Next (Auto Queue):"),blend_editor.next); + blend_editor.dialog->set_title(TTR("Cross-Animation Blend Times")); updating_blends=false; blend_editor.tree->connect("item_edited",this,"_blend_edited"); diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index 0ad849c2f9..5f3c8ec49b 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -203,7 +203,7 @@ public: virtual Dictionary get_state() const { return anim_editor->get_state(); } virtual void set_state(const Dictionary& p_state) { anim_editor->set_state(p_state); } - virtual String get_name() const { return "Anim"; } + virtual String get_name() const { return TTR("Anim"); } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 7e1214ec83..dc857bfacb 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -274,7 +274,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { if (renaming_edit) { - edit_label[0]->set_text("New name:"); + edit_label[0]->set_text(TTR("New name:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_line[0]->set_begin(Point2(15,25)); @@ -314,7 +314,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { } return; case AnimationTreePlayer::NODE_TIMESCALE: - edit_label[0]->set_text("Scale:"); + edit_label[0]->set_text(TTR("Scale:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_line[0]->set_begin(Point2(15,25)); @@ -323,13 +323,13 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_dialog->set_size(Size2(150,50)); break; case AnimationTreePlayer::NODE_ONESHOT: - edit_label[0]->set_text("Fade In (s):"); + edit_label[0]->set_text(TTR("Fade In (s):")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_line[0]->set_begin(Point2(15,25)); edit_line[0]->set_text(rtos(anim_tree->oneshot_node_get_fadein_time(edited_node))); edit_line[0]->show(); - edit_label[1]->set_text("Fade Out (s):"); + edit_label[1]->set_text(TTR("Fade Out (s):")); edit_label[1]->set_pos(Point2(5,55)); edit_label[1]->show(); edit_line[1]->set_begin(Point2(15,75)); @@ -337,25 +337,25 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_line[1]->show(); edit_option->clear(); - edit_option->add_item("Blend",0); - edit_option->add_item("Mix",1); + edit_option->add_item(TTR("Blend"),0); + edit_option->add_item(TTR("Mix"),1); edit_option->set_begin(Point2(15,105)); edit_option->select( anim_tree->oneshot_node_get_mix_mode(edited_node)); edit_option->show(); - edit_check->set_text("Auto Restart:"); + edit_check->set_text(TTR("Auto Restart:")); edit_check->set_begin(Point2(15,125)); edit_check->set_pressed(anim_tree->oneshot_node_has_autorestart(edited_node)); edit_check->show(); - edit_label[2]->set_text("Restart (s):"); + edit_label[2]->set_text(TTR("Restart (s):")); edit_label[2]->set_pos(Point2(5,145)); edit_label[2]->show(); edit_line[2]->set_begin(Point2(15,165)); edit_line[2]->set_text(rtos(anim_tree->oneshot_node_get_autorestart_delay(edited_node))); edit_line[2]->show(); - edit_label[3]->set_text("Random Restart (s):"); + edit_label[3]->set_text(TTR("Random Restart (s):")); edit_label[3]->set_pos(Point2(5,195)); edit_label[3]->show(); edit_line[3]->set_begin(Point2(15,215)); @@ -366,7 +366,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { filter_button->show(); edit_button->set_begin(Point2(10,268)); - edit_button->set_text("Start!"); + edit_button->set_text(TTR("Start!")); edit_button->show(); @@ -376,7 +376,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { case AnimationTreePlayer::NODE_MIX: - edit_label[0]->set_text("Amount:"); + edit_label[0]->set_text(TTR("Amount:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_scroll[0]->set_min(0); @@ -388,7 +388,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { break; case AnimationTreePlayer::NODE_BLEND2: - edit_label[0]->set_text("Blend:"); + edit_label[0]->set_text(TTR("Blend:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_scroll[0]->set_min(0); @@ -403,7 +403,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { break; case AnimationTreePlayer::NODE_BLEND3: - edit_label[0]->set_text("Blend:"); + edit_label[0]->set_text(TTR("Blend:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_scroll[0]->set_min(-1); @@ -416,7 +416,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { break; case AnimationTreePlayer::NODE_BLEND4: - edit_label[0]->set_text("Blend 0:"); + edit_label[0]->set_text(TTR("Blend 0:")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_scroll[0]->set_min(0); @@ -424,7 +424,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_scroll[0]->set_val(anim_tree->blend4_node_get_amount(edited_node).x); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); - edit_label[1]->set_text("Blend 1:"); + edit_label[1]->set_text(TTR("Blend 1:")); edit_label[1]->set_pos(Point2(5,55)); edit_label[1]->show(); edit_scroll[1]->set_min(0); @@ -439,14 +439,14 @@ void AnimationTreeEditor::_popup_edit_dialog() { case AnimationTreePlayer::NODE_TRANSITION: { - edit_label[0]->set_text("X-Fade Time (s):"); + edit_label[0]->set_text(TTR("X-Fade Time (s):")); edit_label[0]->set_pos(Point2(5,5)); edit_label[0]->show(); edit_line[0]->set_begin(Point2(15,25)); edit_line[0]->set_text(rtos(anim_tree->transition_node_get_xfade_time(edited_node))); edit_line[0]->show(); - edit_label[1]->set_text("Current:"); + edit_label[1]->set_text(TTR("Current:")); edit_label[1]->set_pos(Point2(5,55)); edit_label[1]->show(); edit_option->set_begin(Point2(15,75)); @@ -812,15 +812,15 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) { if (rclick_type==CLICK_INPUT_SLOT || rclick_type==CLICK_OUTPUT_SLOT) { node_popup->clear(); - node_popup->add_item("Disconnect",NODE_DISCONNECT); + node_popup->add_item(TTR("Disconnect"),NODE_DISCONNECT); if (anim_tree->node_get_type(rclick_node)==AnimationTreePlayer::NODE_TRANSITION) { - node_popup->add_item("Add Input",NODE_ADD_INPUT); + node_popup->add_item(TTR("Add Input"),NODE_ADD_INPUT); if (rclick_type==CLICK_INPUT_SLOT) { if (anim_tree->transition_node_has_input_auto_advance(rclick_node,rclick_slot)) - node_popup->add_item("Clear Auto-Advance",NODE_CLEAR_AUTOADVANCE); + node_popup->add_item(TTR("Clear Auto-Advance"),NODE_CLEAR_AUTOADVANCE); else - node_popup->add_item("Set Auto-Advance",NODE_SET_AUTOADVANCE); - node_popup->add_item("Delete Input",NODE_DELETE_INPUT); + node_popup->add_item(TTR("Set Auto-Advance"),NODE_SET_AUTOADVANCE); + node_popup->add_item(TTR("Delete Input"),NODE_DELETE_INPUT); } } @@ -832,10 +832,10 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) { if (rclick_type==CLICK_NODE) { node_popup->clear(); - node_popup->add_item("Rename",NODE_RENAME); - node_popup->add_item("Remove",NODE_ERASE); + node_popup->add_item(TTR("Rename"),NODE_RENAME); + node_popup->add_item(TTR("Remove"),NODE_ERASE); if (anim_tree->node_get_type(rclick_node)==AnimationTreePlayer::NODE_TRANSITION) - node_popup->add_item("Add Input",NODE_ADD_INPUT); + node_popup->add_item(TTR("Add Input"),NODE_ADD_INPUT); node_popup->set_pos(rclick_pos+get_global_pos()); node_popup->popup(); } @@ -990,12 +990,12 @@ void AnimationTreeEditor::_notification(int p_what) { case AnimationTreePlayer::CONNECT_OK: { Ref<Font> f = get_font("font","Label"); - f->draw(get_canvas_item(),Point2(5,25+f->get_ascent()),"Animation Tree is Valid.",Color(0,1,0.6,0.8)); + f->draw(get_canvas_item(),Point2(5,25+f->get_ascent()),TTR("Animation Tree is Valid."),Color(0,1,0.6,0.8)); } break; default: { Ref<Font> f = get_font("font","Label"); - f->draw(get_canvas_item(),Point2(5,25+f->get_ascent()),"Animation Tree is Invalid.",Color(1,0.6,0.0,0.8)); + f->draw(get_canvas_item(),Point2(5,25+f->get_ascent()),TTR("Animation Tree is Invalid."),Color(1,0.6,0.0,0.8)); } break; } @@ -1359,19 +1359,19 @@ AnimationTreeEditor::AnimationTreeEditor() { add_child( add_menu ); p=add_menu->get_popup(); - p->add_item("Animation Node",AnimationTreePlayer::NODE_ANIMATION); - p->add_item("OneShot Node",AnimationTreePlayer::NODE_ONESHOT); - p->add_item("Mix Node",AnimationTreePlayer::NODE_MIX); - p->add_item("Blend2 Node",AnimationTreePlayer::NODE_BLEND2); - p->add_item("Blend3 Node",AnimationTreePlayer::NODE_BLEND3); - p->add_item("Blend4 Node",AnimationTreePlayer::NODE_BLEND4); - p->add_item("TimeScale Node",AnimationTreePlayer::NODE_TIMESCALE); - p->add_item("TimeSeek Node",AnimationTreePlayer::NODE_TIMESEEK); - p->add_item("Transition Node",AnimationTreePlayer::NODE_TRANSITION); + p->add_item(TTR("Animation Node"),AnimationTreePlayer::NODE_ANIMATION); + p->add_item(TTR("OneShot Node"),AnimationTreePlayer::NODE_ONESHOT); + p->add_item(TTR("Mix Node"),AnimationTreePlayer::NODE_MIX); + p->add_item(TTR("Blend2 Node"),AnimationTreePlayer::NODE_BLEND2); + p->add_item(TTR("Blend3 Node"),AnimationTreePlayer::NODE_BLEND3); + p->add_item(TTR("Blend4 Node"),AnimationTreePlayer::NODE_BLEND4); + p->add_item(TTR("TimeScale Node"),AnimationTreePlayer::NODE_TIMESCALE); + p->add_item(TTR("TimeSeek Node"),AnimationTreePlayer::NODE_TIMESEEK); + p->add_item(TTR("Transition Node"),AnimationTreePlayer::NODE_TRANSITION); p->add_separator(); - p->add_item("Import Animations...", MENU_IMPORT_ANIMATIONS); // wtf + p->add_item(TTR("Import Animations..."), MENU_IMPORT_ANIMATIONS); // wtf p->add_separator(); - p->add_item("Clear",MENU_GRAPH_CLEAR); + p->add_item(TTR("Clear"),MENU_GRAPH_CLEAR); p->connect("item_pressed", this,"_add_menu_item"); @@ -1471,7 +1471,7 @@ AnimationTreeEditor::AnimationTreeEditor() { file_dialog->connect("file_selected", this, "_file_dialog_selected"); filter_dialog = memnew( AcceptDialog ); - filter_dialog->set_title("Edit Node Filters"); + filter_dialog->set_title(TTR("Edit Node Filters")); add_child(filter_dialog); filter = memnew( Tree ); @@ -1484,7 +1484,7 @@ AnimationTreeEditor::AnimationTreeEditor() { filter_button->set_margin(MARGIN_RIGHT, 10); edit_dialog->add_child(filter_button); filter_button->hide();; - filter_button->set_text("Filters.."); + filter_button->set_text(TTR("Filters..")); filter_button->connect("pressed", this,"_edit_filters"); } @@ -1524,7 +1524,7 @@ AnimationTreeEditorPlugin::AnimationTreeEditorPlugin(EditorNode *p_node) { anim_tree_editor = memnew( AnimationTreeEditor ); anim_tree_editor->set_custom_minimum_size(Size2(0,300)); - button=editor->add_bottom_panel_item("AnimationTree",anim_tree_editor); + button=editor->add_bottom_panel_item(TTR("AnimationTree"),anim_tree_editor); button->hide(); diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/tools/editor/plugins/animation_tree_editor_plugin.h index 4884a22d90..989a6b0b04 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.h +++ b/tools/editor/plugins/animation_tree_editor_plugin.h @@ -180,7 +180,7 @@ class AnimationTreeEditorPlugin : public EditorPlugin { public: - virtual String get_name() const { return "AnimTree"; } + virtual String get_name() const { return TTR("AnimTree"); } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index 4599dbfb54..a37bbce6fe 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -728,14 +728,14 @@ void BakedLightBaker::_make_octree() { for(int i=0;i<8;i++) root->children[i]=0; - EditorProgress ep("bake_octree","Parsing "+itos(triangles.size())+" Triangles:",triangles.size()); + EditorProgress ep("bake_octree",TTR("Parsing ")+itos(triangles.size())+" Triangles:",triangles.size()); for(int i=0;i<triangles.size();i++) { _octree_insert(0,&triangles[i],octree_depth-1); if ((i%1000)==0) { - ep.step("Triangle# "+itos(i),i); + ep.step(TTR("Triangle# ")+itos(i),i); } } @@ -1533,7 +1533,7 @@ void BakedLightBaker::_make_octree_texture() { baked_octree_texture_h=nearest_power_of_2(baked_octree_texture_h); - print_line("RESULT! "+itos(baked_octree_texture_w)+","+itos(baked_octree_texture_h)); + print_line(TTR("RESULT! ")+itos(baked_octree_texture_w)+","+itos(baked_octree_texture_h)); } @@ -1716,7 +1716,7 @@ void BakedLightBaker::bake(const Ref<BakedLight> &p_light, Node* p_node) { cell_count=0; base_inv=p_node->cast_to<Spatial>()->get_global_transform().affine_inverse(); - EditorProgress ep("bake","Light Baker Setup:",5); + EditorProgress ep("bake",TTR("Light Baker Setup:"),5); baked_light=p_light; lattice_size=baked_light->get_initial_lattice_subdiv(); octree_depth=baked_light->get_cell_subdivision(); @@ -1743,18 +1743,18 @@ void BakedLightBaker::bake(const Ref<BakedLight> &p_light, Node* p_node) { } - ep.step("Parsing Geometry",0); + ep.step(TTR("Parsing Geometry"),0); _parse_geometry(p_node); mat_map.clear(); tex_map.clear(); print_line("\ttotal triangles: "+itos(triangles.size())); - ep.step("Fixing Lights",1); + ep.step(TTR("Fixing Lights"),1); _fix_lights(); - ep.step("Making BVH",2); + ep.step(TTR("Making BVH"),2); _make_bvh(); - ep.step("Creating Light Octree",3); + ep.step(TTR("Creating Light Octree"),3); _make_octree(); - ep.step("Creating Octree Texture",4); + ep.step(TTR("Creating Octree Texture"),4); _make_octree_texture(); baking=true; _start_thread(); @@ -1810,7 +1810,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) { if (octant.children[j]) { tmp_smp.push_back(octants[octant.children[j]].sampler_ofs); if (octants[octant.children[j]].sampler_ofs==0) { - print_line("FUUUUUUUUCK"); + print_line(TTR("FUUUUUUUUCK")); } } } @@ -2357,7 +2357,7 @@ Error BakedLightBaker::transfer_to_lightmaps() { if (!triangles.size() || baked_textures.size()==0) return ERR_UNCONFIGURED; - EditorProgress ep("transfer_to_lightmaps","Transfer to Lightmaps:",baked_textures.size()*2+triangles.size()); + EditorProgress ep("transfer_to_lightmaps",TTR("Transfer to Lightmaps:"),baked_textures.size()*2+triangles.size()); for(int i=0;i<baked_textures.size();i++) { @@ -2365,7 +2365,7 @@ Error BakedLightBaker::transfer_to_lightmaps() { baked_textures[i].data.resize( baked_textures[i].width*baked_textures[i].height*4 ); zeromem(baked_textures[i].data.ptr(),baked_textures[i].data.size()); - ep.step("Allocating Texture #"+itos(i+1),i); + ep.step(TTR("Allocating Texture #")+itos(i+1),i); } Vector<double> norm_arr; @@ -2382,7 +2382,7 @@ Error BakedLightBaker::transfer_to_lightmaps() { for(int i=0;i<triangles.size();i++) { if (i%200==0) { - ep.step("Baking Triangle #"+itos(i),i+baked_textures.size()); + ep.step(TTR("Baking Triangle #")+itos(i),i+baked_textures.size()); } Triangle &t=triangles[i]; if (t.baked_texture<0 || t.baked_texture>=baked_textures.size()) @@ -2505,7 +2505,7 @@ Error BakedLightBaker::transfer_to_lightmaps() { { - ep.step("Post-Processing Texture #"+itos(i),i+baked_textures.size()+triangles.size()); + ep.step(TTR("Post-Processing Texture #")+itos(i),i+baked_textures.size()+triangles.size()); BakeTexture &bt=baked_textures[i]; diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index 56aabaf6d9..690b2cd55e 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -97,7 +97,7 @@ void BakedLightEditor::_notification(int p_option) { } } - print_line("MSCOL: "+itos(OS::get_singleton()->get_ticks_msec()-t)); + print_line(TTR("MSCOL: ")+itos(OS::get_singleton()->get_ticks_msec()-t)); t = OS::get_singleton()->get_ticks_msec(); Array a; @@ -132,14 +132,14 @@ void BakedLightEditor::_notification(int p_option) { bake_info->set_text("rays/s: "+itos(rays_sec)); update_timeout=1; - print_line("MSUPDATE: "+itos(OS::get_singleton()->get_ticks_msec()-t)); + print_line(TTR("MSUPDATE: ")+itos(OS::get_singleton()->get_ticks_msec()-t)); t=OS::get_singleton()->get_ticks_msec(); node->get_baked_light()->set_octree(octree_texture); node->get_baked_light()->set_light(light_texture); node->get_baked_light()->set_sampler_octree(octree_sampler); node->get_baked_light()->set_edited(true); - print_line("MSSET: "+itos(OS::get_singleton()->get_ticks_msec()-t)); + print_line(TTR("MSSET: ")+itos(OS::get_singleton()->get_ticks_msec()-t)); @@ -179,7 +179,7 @@ void BakedLightEditor::_bake_pressed() { ERR_FAIL_COND(!node); if (node->get_baked_light().is_null()) { - err_dialog->set_text("BakedLightInstance does not contain a BakedLight resource."); + err_dialog->set_text(TTR("BakedLightInstance does not contain a BakedLight resource.")); err_dialog->popup_centered_minsize(); button_bake->set_pressed(false); return; @@ -264,7 +264,7 @@ BakedLightEditor::BakedLightEditor() { bake_hbox = memnew( HBoxContainer ); button_bake = memnew( ToolButton ); - button_bake->set_text("Bake!"); + button_bake->set_text(TTR("Bake!")); button_bake->set_toggle_mode(true); button_reset = memnew( Button ); button_make_lightmaps = memnew( Button ); @@ -289,7 +289,7 @@ BakedLightEditor::BakedLightEditor() { button_reset->connect("pressed",this,"_clear_pressed"); button_make_lightmaps->connect("pressed",this,"_bake_lightmaps"); button_reset->hide(); - button_reset->set_tooltip("Reset the lightmap octree baking process (start over)."); + button_reset->set_tooltip(TTR("Reset the lightmap octree baking process (start over).")); update_timeout=0; diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp index 7433264b16..9c25de695c 100644 --- a/tools/editor/plugins/camera_editor_plugin.cpp +++ b/tools/editor/plugins/camera_editor_plugin.cpp @@ -87,7 +87,7 @@ CameraEditor::CameraEditor() { preview = memnew( Button ); add_child(preview); - preview->set_text("Preview"); + preview->set_text(TTR("Preview")); preview->set_toggle_mode(true); preview->set_anchor(MARGIN_LEFT,Control::ANCHOR_END); preview->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 31f50b65f5..76fa1ef8e2 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -62,8 +62,8 @@ public: VBoxContainer *container; GridContainer *child_container; - set_title("Configure Snap"); - get_ok()->set_text("Close"); + set_title(TTR("Configure Snap")); + get_ok()->set_text(TTR("Close")); container = memnew( VBoxContainer ); add_child(container); @@ -74,7 +74,7 @@ public: container->add_child(child_container); label = memnew( Label ); - label->set_text("Grid Offset:"); + label->set_text(TTR("Grid Offset:")); child_container->add_child(label); label->set_h_size_flags(SIZE_EXPAND_FILL); @@ -91,7 +91,7 @@ public: child_container->add_child(grid_offset_y); label = memnew( Label ); - label->set_text("Grid Step:"); + label->set_text(TTR("Grid Step:")); child_container->add_child(label); label->set_h_size_flags(SIZE_EXPAND_FILL); @@ -114,7 +114,7 @@ public: container->add_child(child_container); label = memnew( Label ); - label->set_text("Rotation Offset:"); + label->set_text(TTR("Rotation Offset:")); child_container->add_child(label); label->set_h_size_flags(SIZE_EXPAND_FILL); @@ -125,7 +125,7 @@ public: child_container->add_child(rotation_offset); label = memnew( Label ); - label->set_text("Rotation Step:"); + label->set_text(TTR("Rotation Step:")); child_container->add_child(label); label->set_h_size_flags(SIZE_EXPAND_FILL); @@ -158,7 +158,7 @@ public: void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { List<Node*> &selection = editor_selection->get_selected_node_list(); - undo_redo->create_action("Move Pivot"); + undo_redo->create_action(TTR("Move Pivot")); for(List<Node*>::Element *E=selection.front();E;E=E->next()) { @@ -645,7 +645,7 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE if (editor_selection->get_selected_node_list().empty()) return; - undo_redo->create_action("Move Action",true); + undo_redo->create_action(TTR("Move Action"),true); List<Node*> &selection = editor_selection->get_selected_node_list(); @@ -1193,7 +1193,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (bone_ik_list.size()) { - undo_redo->create_action("Edit IK Chain"); + undo_redo->create_action(TTR("Edit IK Chain")); for(List<BoneIK>::Element *E=bone_ik_list.back();E;E=E->prev()) { @@ -1209,7 +1209,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { undo_redo->commit_action(); } else { - undo_redo->create_action("Edit CanvasItem"); + undo_redo->create_action(TTR("Edit CanvasItem")); List<Node*> &selection = editor_selection->get_selected_node_list(); @@ -1730,7 +1730,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if ((leaf_pos.distance_to(root_pos)) > total_len) { //oops dude you went too far - //print_line("TOO FAR!"); + //print_line(TTR("TOO FAR!")); Vector2 rel = leaf_pos - root_pos; rel = rel.normalized() * total_len; leaf_pos=root_pos+rel; @@ -1739,7 +1739,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { bone_ik_list.front()->get().pos=leaf_pos; - //print_line("BONE IK LIST "+itos(bone_ik_list.size())); + //print_line(TTR("BONE IK LIST ")+itos(bone_ik_list.size())); if (bone_ik_list.size()>2) { @@ -1764,22 +1764,22 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { //print_line("back"); Vector2 rel = E->get().pos - E->next()->get().pos; - //print_line("PREV "+E->get().pos); + //print_line(TTR("PREV ")+E->get().pos); Vector2 desired = E->next()->get().pos+rel.normalized()*len; - //print_line("DESIRED "+desired); + //print_line(TTR("DESIRED ")+desired); E->get().pos=E->get().pos.linear_interpolate(desired,solver_k); - //print_line("POST "+E->get().pos); + //print_line(TTR("POST ")+E->get().pos); } else if (E==bone_ik_list.front()) { //only adjust parent //print_line("front"); Vector2 rel = E->next()->get().pos - E->get().pos; - //print_line("PREV "+E->next()->get().pos); + //print_line(TTR("PREV ")+E->next()->get().pos); Vector2 desired = E->get().pos+rel.normalized()*len; - //print_line("DESIRED "+desired); + //print_line(TTR("DESIRED ")+desired); E->next()->get().pos=E->next()->get().pos.linear_interpolate(desired,solver_k); - //print_line("POST "+E->next()->get().pos); + //print_line(TTR("POST ")+E->next()->get().pos); } else { Vector2 rel = E->next()->get().pos - E->get().pos; @@ -1904,7 +1904,7 @@ void CanvasItemEditor::_viewport_draw() { if (h_scroll->is_visible()) size.height-=h_scroll->get_size().height; - get_stylebox("EditorFocus","EditorStyles")->draw(ci,Rect2(Point2(),size)); + get_stylebox(TTR("EditorFocus"),"EditorStyles")->draw(ci,Rect2(Point2(),size)); } Ref<Texture> lock = get_icon("Lock","EditorIcons"); @@ -2227,7 +2227,7 @@ void CanvasItemEditor::_notification(int p_what) { key_insert_button->set_icon(get_icon("Key","EditorIcons")); - //anchor_menu->add_icon_override("Align Top Left"); + //anchor_menu->add_icon_override(TTR("Align Top Left")); anchor_menu->set_icon(get_icon("Anchor","EditorIcons")); PopupMenu *p=anchor_menu->get_popup(); @@ -2462,7 +2462,7 @@ void CanvasItemEditor::_update_scroll(float) { void CanvasItemEditor::_set_anchor(Control::AnchorType p_left,Control::AnchorType p_top,Control::AnchorType p_right,Control::AnchorType p_bottom) { List<Node*> &selection = editor_selection->get_selected_node_list(); - undo_redo->create_action("Change Anchors"); + undo_redo->create_action(TTR("Change Anchors")); for(List<Node*>::Element *E=selection.front();E;E=E->next()) { Control *c = E->get()->cast_to<Control>(); @@ -2541,7 +2541,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { updating_value_dialog=true; - dialog_label->set_text("Zoom (%):"); + dialog_label->set_text(TTR("Zoom (%):")); dialog_val->set_min(0.1); dialog_val->set_step(0.1); dialog_val->set_max(800); @@ -2896,7 +2896,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!pose_clipboard.size()) break; - undo_redo->create_action("Paste Pose"); + undo_redo->create_action(TTR("Paste Pose")); for (List<PoseClipboard>::Element *E=pose_clipboard.front();E;E=E->next()) { Object *o = ObjectDB::get_instance(E->get().id); @@ -3145,7 +3145,7 @@ void CanvasItemEditor::end_drag() { if (undo_redo) { - undo_redo->create_action("Edit CanvasItem"); + undo_redo->create_action(TTR("Edit CanvasItem")); for(CanvasItemMap::Element *E=canvas_items.front();E;E=E->next()) { CanvasItem *canvas_item = E->key(); Variant state=canvas_item->edit_get_state(); @@ -3290,13 +3290,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { move_button->set_toggle_mode(true); hb->add_child(move_button); move_button->connect("pressed",this,"_tool_select",make_binds(TOOL_MOVE)); - move_button->set_tooltip("Move Mode (W)"); + move_button->set_tooltip(TTR("Move Mode (W)")); rotate_button = memnew( ToolButton ); rotate_button->set_toggle_mode(true); hb->add_child(rotate_button); rotate_button->connect("pressed",this,"_tool_select",make_binds(TOOL_ROTATE)); - rotate_button->set_tooltip("Rotate Mode (E)"); + rotate_button->set_tooltip(TTR("Rotate Mode (E)")); hb->add_child(memnew(VSeparator)); @@ -3310,13 +3310,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { pivot_button->set_toggle_mode(true); hb->add_child(pivot_button); pivot_button->connect("pressed",this,"_tool_select",make_binds(TOOL_EDIT_PIVOT)); - pivot_button->set_tooltip("Click to change object's rotation pivot"); + pivot_button->set_tooltip(TTR("Click to change object's rotation pivot")); pan_button = memnew( ToolButton ); pan_button->set_toggle_mode(true); hb->add_child(pan_button); pan_button->connect("pressed",this,"_tool_select",make_binds(TOOL_PAN)); - pan_button->set_tooltip("Pan Mode"); + pan_button->set_tooltip(TTR("Pan Mode")); hb->add_child(memnew(VSeparator)); @@ -3329,7 +3329,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { unlock_button = memnew( ToolButton ); hb->add_child(unlock_button); unlock_button->connect("pressed",this,"_popup_callback",varray(UNLOCK_SELECTED)); - unlock_button->set_tooltip("Unlock the selected object (can be moved)."); + unlock_button->set_tooltip(TTR("Unlock the selected object (can be moved).")); group_button = memnew( ToolButton ); hb->add_child(group_button); @@ -3344,57 +3344,57 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { hb->add_child(memnew(VSeparator)); edit_menu = memnew( MenuButton ); - edit_menu->set_text("Edit"); + edit_menu->set_text(TTR("Edit")); hb->add_child(edit_menu); edit_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); PopupMenu *p; p = edit_menu->get_popup(); - p->add_check_item("Use Snap",SNAP_USE); - p->add_check_item("Show Grid",SNAP_SHOW_GRID); - p->add_check_item("Use Rotation Snap",SNAP_USE_ROTATION); - p->add_check_item("Snap Relative",SNAP_RELATIVE); - p->add_item("Configure Snap..",SNAP_CONFIGURE); + p->add_check_item(TTR("Use Snap"),SNAP_USE); + p->add_check_item(TTR("Show Grid"),SNAP_SHOW_GRID); + p->add_check_item(TTR("Use Rotation Snap"),SNAP_USE_ROTATION); + p->add_check_item(TTR("Snap Relative"),SNAP_RELATIVE); + p->add_item(TTR("Configure Snap.."),SNAP_CONFIGURE); p->add_separator(); - p->add_check_item("Use Pixel Snap",SNAP_USE_PIXEL); + p->add_check_item(TTR("Use Pixel Snap"),SNAP_USE_PIXEL); p->add_separator(); - p->add_item("Expand to Parent",EXPAND_TO_PARENT,KEY_MASK_CMD|KEY_P); + p->add_item(TTR("Expand to Parent"),EXPAND_TO_PARENT,KEY_MASK_CMD|KEY_P); p->add_separator(); - p->add_submenu_item("Skeleton..","skeleton"); + p->add_submenu_item(TTR("Skeleton.."),"skeleton"); PopupMenu *p2 = memnew(PopupMenu); p->add_child(p2); p2->set_name("skeleton"); - p2->add_item("Make Bones",SKELETON_MAKE_BONES,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_B); - p2->add_item("Clear Bones",SKELETON_CLEAR_BONES); + p2->add_item(TTR("Make Bones"),SKELETON_MAKE_BONES,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_B); + p2->add_item(TTR("Clear Bones"),SKELETON_CLEAR_BONES); p2->add_separator(); - p2->add_item("Make IK Chain",SKELETON_SET_IK_CHAIN); - p2->add_item("Clear IK Chain",SKELETON_CLEAR_IK_CHAIN); + p2->add_item(TTR("Make IK Chain"),SKELETON_SET_IK_CHAIN); + p2->add_item(TTR("Clear IK Chain"),SKELETON_CLEAR_IK_CHAIN); p2->connect("item_pressed", this,"_popup_callback"); /* - p->add_item("Align Horizontal",ALIGN_HORIZONTAL); - p->add_item("Align Vertical",ALIGN_VERTICAL); - p->add_item("Space Horizontal",SPACE_HORIZONTAL); - p->add_item("Space Vertical",SPACE_VERTICAL);*/ + p->add_item(TTR("Align Horizontal"),ALIGN_HORIZONTAL); + p->add_item(TTR("Align Vertical"),ALIGN_VERTICAL); + p->add_item(TTR("Space Horizontal"),SPACE_HORIZONTAL); + p->add_item(TTR("Space Vertical"),SPACE_VERTICAL);*/ view_menu = memnew( MenuButton ); - view_menu->set_text("View"); + view_menu->set_text(TTR("View")); hb->add_child(view_menu); view_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); p = view_menu->get_popup(); - p->add_item("Zoom In",ZOOM_IN); - p->add_item("Zoom Out",ZOOM_OUT); - p->add_item("Zoom Reset",ZOOM_RESET); - p->add_item("Zoom Set..",ZOOM_SET); + p->add_item(TTR("Zoom In"),ZOOM_IN); + p->add_item(TTR("Zoom Out"),ZOOM_OUT); + p->add_item(TTR("Zoom Reset"),ZOOM_RESET); + p->add_item(TTR("Zoom Set.."),ZOOM_SET); p->add_separator(); - p->add_item("Center Selection", VIEW_CENTER_TO_SELECTION, KEY_F); - p->add_item("Frame Selection", VIEW_FRAME_TO_SELECTION, KEY_MASK_CMD|KEY_F); + p->add_item(TTR("Center Selection"), VIEW_CENTER_TO_SELECTION, KEY_F); + p->add_item(TTR("Frame Selection"), VIEW_FRAME_TO_SELECTION, KEY_MASK_CMD|KEY_F); anchor_menu = memnew( MenuButton ); - anchor_menu->set_text("Anchor"); + anchor_menu->set_text(TTR("Anchor")); hb->add_child(anchor_menu); anchor_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); anchor_menu->hide(); @@ -3434,7 +3434,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_insert_button = memnew( Button ); key_insert_button->set_focus_mode(FOCUS_NONE); key_insert_button->connect("pressed",this,"_popup_callback",varray(ANIM_INSERT_KEY)); - key_insert_button->set_tooltip("Insert Keys (Insert)"); + key_insert_button->set_tooltip(TTR("Insert Keys (Insert)")); animation_hb->add_child(key_insert_button); @@ -3445,24 +3445,24 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p = animation_menu->get_popup(); - p->add_item("Insert Key",ANIM_INSERT_KEY,KEY_INSERT); - p->add_item("Insert Key (Existing Tracks)",ANIM_INSERT_KEY_EXISTING,KEY_MASK_CMD+KEY_INSERT); + p->add_item(TTR("Insert Key"),ANIM_INSERT_KEY,KEY_INSERT); + p->add_item(TTR("Insert Key (Existing Tracks)"),ANIM_INSERT_KEY_EXISTING,KEY_MASK_CMD+KEY_INSERT); p->add_separator(); - p->add_item("Copy Pose",ANIM_COPY_POSE); - p->add_item("Paste Pose",ANIM_PASTE_POSE); - p->add_item("Clear Pose",ANIM_CLEAR_POSE,KEY_MASK_SHIFT|KEY_K); + p->add_item(TTR("Copy Pose"),ANIM_COPY_POSE); + p->add_item(TTR("Paste Pose"),ANIM_PASTE_POSE); + p->add_item(TTR("Clear Pose"),ANIM_CLEAR_POSE,KEY_MASK_SHIFT|KEY_K); snap_dialog = memnew( SnapDialog ); snap_dialog->connect("confirmed",this,"_snap_changed"); add_child(snap_dialog); value_dialog = memnew( AcceptDialog ); - value_dialog->set_title("Set a Value"); - value_dialog->get_ok()->set_text("Close"); + value_dialog->set_title(TTR("Set a Value")); + value_dialog->get_ok()->set_text(TTR("Close")); add_child(value_dialog); Label *l = memnew(Label); - l->set_text("Snap (Pixels):"); + l->set_text(TTR("Snap (Pixels):")); l->set_pos(Point2(5,5)); value_dialog->add_child(l); dialog_label=l; diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 8eea723126..8abb51159e 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -57,7 +57,7 @@ void CollisionPolygon2DEditor::_menu_option(int p_option) { void CollisionPolygon2DEditor::_wip_close() { - undo_redo->create_action("Create Poly"); + undo_redo->create_action(TTR("Create Poly")); undo_redo->add_undo_method(node,"set_polygon",node->get_polygon()); undo_redo->add_do_method(node,"set_polygon",wip); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -149,7 +149,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { if (poly.size() < 3) { - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.push_back(cpoint); undo_redo->add_do_method(node,"set_polygon",poly); @@ -229,7 +229,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly[edited_point]=edited_point_pos; - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node,"set_polygon",poly); undo_redo->add_undo_method(node,"set_polygon",pre_move_edit); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -263,7 +263,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.remove(closest_idx); undo_redo->add_do_method(node,"set_polygon",poly); @@ -390,7 +390,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { add_child(button_create); button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE)); button_create->set_toggle_mode(true); - button_create->set_tooltip("Create a new polygon from scratch"); + button_create->set_tooltip(TTR("Create a new polygon from scratch")); button_edit = memnew( ToolButton ); add_child(button_edit); @@ -404,8 +404,8 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index 44854e655f..5cd09f1a93 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -92,7 +92,7 @@ void CollisionPolygonEditor::_menu_option(int p_option) { void CollisionPolygonEditor::_wip_close() { - undo_redo->create_action("Create Poly3D"); + undo_redo->create_action(TTR("Create Poly3D")); undo_redo->add_undo_method(node,"set_polygon",node->get_polygon()); undo_redo->add_do_method(node,"set_polygon",wip); undo_redo->add_do_method(this,"_polygon_draw"); @@ -200,7 +200,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const if (poly.size() < 3) { - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.push_back(cpoint); undo_redo->add_do_method(node,"set_polygon",poly); @@ -282,7 +282,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly[edited_point]=edited_point_pos; - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node,"set_polygon",poly); undo_redo->add_undo_method(node,"set_polygon",pre_move_edit); undo_redo->add_do_method(this,"_polygon_draw"); @@ -316,7 +316,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const if (closest_idx>=0) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.remove(closest_idx); undo_redo->add_do_method(node,"set_polygon",poly); @@ -559,8 +559,8 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp index 1916d55ee1..296362447f 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -180,7 +180,7 @@ void CollisionShape2DEditor::set_handle(int idx, Point2& p_point) { void CollisionShape2DEditor::commit_handle(int idx, Variant& p_org) { Control* c = canvas_item_editor->get_viewport_control(); - undo_redo->create_action("Set Handle"); + undo_redo->create_action(TTR("Set Handle")); switch ( shape_type ) { case CAPSULE_SHAPE: { diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp index 133775115d..854a0149a5 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp @@ -63,9 +63,9 @@ void ColorRampEditorPlugin::_ramp_changed() { Vector<Color> old_colors=color_ramp_ref->get_colors(); if (old_offsets.size()!=new_offsets.size()) - ur->create_action("Add/Remove Color Ramp Point"); + ur->create_action(TTR("Add/Remove Color Ramp Point")); else - ur->create_action("Modify Color Ramp",true); + ur->create_action(TTR("Modify Color Ramp"),true); ur->add_do_method(this,"undo_redo_color_ramp",new_offsets,new_colors); ur->add_undo_method(this,"undo_redo_color_ramp",old_offsets,old_colors); ur->commit_action(); diff --git a/tools/editor/plugins/control_editor_plugin.cpp b/tools/editor/plugins/control_editor_plugin.cpp index 9dff5e6ce4..0958343f2c 100644 --- a/tools/editor/plugins/control_editor_plugin.cpp +++ b/tools/editor/plugins/control_editor_plugin.cpp @@ -112,7 +112,7 @@ void ControlEditor::_key_move(const Vector2& p_dir, bool p_snap) { if (p_snap) motion*=snap_val->get_text().to_double(); - undo_redo->create_action("Edit Control"); + undo_redo->create_action(TTR("Edit Control")); for(ControlMap::Element *E=controls.front();E;E=E->next()) { Control *control = E->key(); undo_redo->add_do_method(control,"set_pos",control->get_pos()+motion); @@ -156,7 +156,7 @@ void ControlEditor::_input_event(InputEvent p_event) { if (undo_redo) { - undo_redo->create_action("Edit Control"); + undo_redo->create_action(TTR("Edit Control")); for(ControlMap::Element *E=controls.front();E;E=E->next()) { Control *control = E->key(); undo_redo->add_do_method(control,"set_pos",control->get_pos()); @@ -752,17 +752,17 @@ ControlEditor::ControlEditor(EditorNode *p_editor) { handle_len=10; popup=memnew( PopupMenu ); - popup->add_check_item("Use Snap"); - popup->add_item("Configure Snap.."); + popup->add_check_item(TTR("Use Snap")); + popup->add_item(TTR("Configure Snap..")); add_child(popup); snap_dialog = memnew( ConfirmationDialog ); snap_dialog->get_ok()->hide(); - snap_dialog->get_cancel()->set_text("Close"); + snap_dialog->get_cancel()->set_text(TTR("Close")); add_child(snap_dialog); Label *l = memnew(Label); - l->set_text("Snap:"); + l->set_text(TTR("Snap:")); l->set_pos(Point2(5,5)); snap_dialog->add_child(l); diff --git a/tools/editor/plugins/control_editor_plugin.h b/tools/editor/plugins/control_editor_plugin.h index 6234698ee8..67db981c0d 100644 --- a/tools/editor/plugins/control_editor_plugin.h +++ b/tools/editor/plugins/control_editor_plugin.h @@ -125,7 +125,7 @@ class ControlEditorPlugin : public EditorPlugin { public: - virtual String get_name() const { return "GUI"; } + virtual String get_name() const { return TTR("GUI"); } bool has_main_screen() const { return true; } virtual void edit(Object *p_object); virtual bool handles(Object *p_object) const; diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp index 4d6ea5dfb0..3c9f1886b7 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -165,7 +165,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, VS::get_singleton()->camera_set_orthogonal(cam,1.0,0.01,1000.0); - EditorProgress ep("mlib","Creating Mesh Library",ids.size()); + EditorProgress ep("mlib",TTR("Creating Mesh Library"),ids.size()); for(int i=0;i<ids.size();i++) { @@ -193,7 +193,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, xform.origin.z-=rot_aabb.size.z*2; RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(),scen); VS::get_singleton()->instance_set_transform(inst,xform); - ep.step("Thumbnail..",i); + ep.step(TTR("Thumbnail.."),i); VS::get_singleton()->viewport_queue_screen_capture(vp); Main::iteration(); Image img = VS::get_singleton()->viewport_get_screen_capture(vp); @@ -220,7 +220,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, void MeshLibraryEditor::_import_scene_cbk(const String& p_str) { - print_line("Impot Callback!"); + print_line(TTR("Impot Callback!")); Ref<PackedScene> ps = ResourceLoader::load(p_str,"PackedScene"); ERR_FAIL_COND(ps.is_null()); @@ -256,7 +256,7 @@ void MeshLibraryEditor::_menu_cbk(int p_option) { if (p.begins_with("/MeshLibrary/item") && p.get_slice_count("/")>=3) { to_erase = p.get_slice("/",3).to_int(); - cd->set_text("Remove Item "+itos(to_erase)+"?"); + cd->set_text(TTR("Remove Item ")+itos(to_erase)+"?"); cd->popup_centered(Size2(300,60)); } } break; @@ -288,7 +288,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { List<String> extensions; ResourceLoader::get_recognized_extensions_for_type("PackedScene",&extensions); file->clear_filters(); - file->set_title("Import Scene"); + file->set_title(TTR("Import Scene")); for(int i=0;i<extensions.size();i++) { file->add_filter("*."+extensions[i]+" ; "+extensions[i].to_upper()); @@ -303,11 +303,11 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { panel->add_child(options); options->set_pos(Point2(1,1)); options->set_text("Theme"); - options->get_popup()->add_item("Add Item",MENU_OPTION_ADD_ITEM); - options->get_popup()->add_item("Remove Selected Item",MENU_OPTION_REMOVE_ITEM); + options->get_popup()->add_item(TTR("Add Item"),MENU_OPTION_ADD_ITEM); + options->get_popup()->add_item(TTR("Remove Selected Item"),MENU_OPTION_REMOVE_ITEM); options->get_popup()->add_separator(); - options->get_popup()->add_item("Import from Scene",MENU_OPTION_IMPORT_FROM_SCENE); - options->get_popup()->add_item("Update from Scene",MENU_OPTION_UPDATE_FROM_SCENE); + options->get_popup()->add_item(TTR("Import from Scene"),MENU_OPTION_IMPORT_FROM_SCENE); + options->get_popup()->add_item(TTR("Update from Scene"),MENU_OPTION_UPDATE_FROM_SCENE); options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),true); options->get_popup()->connect("item_pressed", this,"_menu_cbk"); menu=options; diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/tools/editor/plugins/item_list_editor_plugin.cpp index 08af1a0643..9f47d26492 100644 --- a/tools/editor/plugins/item_list_editor_plugin.cpp +++ b/tools/editor/plugins/item_list_editor_plugin.cpp @@ -129,7 +129,7 @@ int ItemListOptionButtonPlugin::get_flags() const { void ItemListOptionButtonPlugin::add_item() { - ob->add_item( "Item "+itos(ob->get_item_count())); + ob->add_item( TTR("Item ")+itos(ob->get_item_count())); _change_notify(); } @@ -171,7 +171,7 @@ int ItemListPopupMenuPlugin::get_flags() const { void ItemListPopupMenuPlugin::add_item() { - pp->add_item( "Item "+itos(pp->get_item_count())); + pp->add_item( TTR("Item ")+itos(pp->get_item_count())); _change_notify(); } @@ -299,12 +299,12 @@ ItemListEditor::ItemListEditor() { add_child( memnew( VSeparator ) ); toolbar_button = memnew( ToolButton ); - toolbar_button->set_text("Items"); + toolbar_button->set_text(TTR("Items")); add_child(toolbar_button); toolbar_button->connect("pressed",this,"_edit_items"); dialog = memnew( AcceptDialog ); - dialog->set_title("Item List Editor"); + dialog->set_title(TTR("Item List Editor")); add_child( dialog ); VBoxContainer *vbc = memnew( VBoxContainer ); @@ -316,14 +316,14 @@ ItemListEditor::ItemListEditor() { vbc->add_child(hbc); add_button = memnew( Button ); - add_button->set_text("Add"); + add_button->set_text(TTR("Add")); hbc->add_child(add_button); add_button->connect("pressed",this,"_add_button"); hbc->add_spacer(); del_button = memnew( Button ); - del_button->set_text("Delete"); + del_button->set_text(TTR("Delete")); hbc->add_child(del_button); del_button->connect("pressed",this,"_delete_button"); diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index 757b5327dd..fe031d1657 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -57,7 +57,7 @@ void LightOccluder2DEditor::_menu_option(int p_option) { void LightOccluder2DEditor::_wip_close(bool p_closed) { - undo_redo->create_action("Create Poly"); + undo_redo->create_action(TTR("Create Poly")); undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_polygon",node->get_occluder_polygon()->get_polygon()); undo_redo->add_do_method(node->get_occluder_polygon().ptr(),"set_polygon",wip); undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_closed",node->get_occluder_polygon()->is_closed()); @@ -164,7 +164,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { if (poly.size() < 3) { - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_polygon",poly); poly.push_back(cpoint); undo_redo->add_do_method(node->get_occluder_polygon().ptr(),"set_polygon",poly); @@ -244,7 +244,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly[edited_point]=edited_point_pos; - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node->get_occluder_polygon().ptr(),"set_polygon",poly); undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_polygon",pre_move_edit); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -278,7 +278,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_polygon",poly); poly.remove(closest_idx); undo_redo->add_do_method(node->get_occluder_polygon().ptr(),"set_polygon",poly); @@ -393,7 +393,7 @@ void LightOccluder2DEditor::_create_poly() { if (!node) return; - undo_redo->create_action("Create Occluder Polygon"); + undo_redo->create_action(TTR("Create Occluder Polygon")); undo_redo->add_do_method(node,"set_occluder_polygon",Ref<OccluderPolygon2D>(memnew( OccluderPolygon2D))); undo_redo->add_undo_method(node,"set_occluder_polygon",Variant(REF())); undo_redo->commit_action(); @@ -421,7 +421,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { add_child(button_create); button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE)); button_create->set_toggle_mode(true); - button_create->set_tooltip("Create a new polygon from scratch"); + button_create->set_tooltip(TTR("Create a new polygon from scratch")); button_edit = memnew( ToolButton ); add_child(button_edit); @@ -431,7 +431,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { create_poly = memnew( ConfirmationDialog ); add_child(create_poly); - create_poly->get_ok()->set_text("Create"); + create_poly->get_ok()->set_text(TTR("Create")); //add_constant_override("separation",0); @@ -440,8 +440,8 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index 5314529a23..8671734c25 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -27,7 +27,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { - err_dialog->set_text("Mesh is empty!"); + err_dialog->set_text(TTR("Mesh is empty!")); err_dialog->popup_centered_minsize(); return; } @@ -56,9 +56,9 @@ void MeshInstanceEditor::_menu_option(int p_option) { Node *owner = node==get_tree()->get_edited_scene_root() ? node : node->get_owner(); if (trimesh_shape) - ur->create_action("Create Static Trimesh Body"); + ur->create_action(TTR("Create Static Trimesh Body")); else - ur->create_action("Create Static Convex Body"); + ur->create_action(TTR("Create Static Convex Body")); ur->add_do_method(node,"add_child",body); ur->add_do_method(body,"set_owner",owner); @@ -70,9 +70,9 @@ void MeshInstanceEditor::_menu_option(int p_option) { } if (trimesh_shape) - ur->create_action("Create Static Trimesh Body"); + ur->create_action(TTR("Create Static Trimesh Body")); else - ur->create_action("Create Static Convex Body"); + ur->create_action(TTR("Create Static Convex Body")); for (List<Node*>::Element *E=selection.front();E;E=E->next()) { @@ -110,7 +110,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { case MENU_OPTION_CREATE_CONVEX_COLLISION_SHAPE: { if (node==get_tree()->get_edited_scene_root()) { - err_dialog->set_text("This doesn't work on scene root!"); + err_dialog->set_text(TTR("This doesn't work on scene root!")); err_dialog->popup_centered_minsize(); return; } @@ -129,9 +129,9 @@ void MeshInstanceEditor::_menu_option(int p_option) { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); if (trimesh_shape) - ur->create_action("Create Trimesh Shape"); + ur->create_action(TTR("Create Trimesh Shape")); else - ur->create_action("Create Convex Shape"); + ur->create_action(TTR("Create Convex Shape")); ur->add_do_method(node->get_parent(),"add_child",cshape); ur->add_do_method(node->get_parent(),"move_child",cshape,node->get_index()+1); @@ -156,7 +156,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { Node *owner = node==get_tree()->get_edited_scene_root() ? node : node->get_owner(); UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Create Navigation Mesh"); + ur->create_action(TTR("Create Navigation Mesh")); ur->add_do_method(node,"add_child",nmi); ur->add_do_method(nmi,"set_owner",owner); @@ -178,7 +178,7 @@ void MeshInstanceEditor::_create_outline_mesh() { Ref<Mesh> mesh = node->get_mesh(); if (mesh.is_null()) { - err_dialog->set_text("MeshInstance lacks a Mesh!"); + err_dialog->set_text(TTR("MeshInstance lacks a Mesh!")); err_dialog->popup_centered_minsize(); return; } @@ -186,7 +186,7 @@ void MeshInstanceEditor::_create_outline_mesh() { Ref<Mesh> mesho = mesh->create_outline(outline_size->get_val()); if (mesho.is_null()) { - err_dialog->set_text("Could not create outline!"); + err_dialog->set_text(TTR("Could not create outline!")); err_dialog->popup_centered_minsize(); return; } @@ -200,7 +200,7 @@ void MeshInstanceEditor::_create_outline_mesh() { UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Create Outline"); + ur->create_action(TTR("Create Outline")); ur->add_do_method(node,"add_child",mi); ur->add_do_method(mi,"set_owner",owner); @@ -225,21 +225,21 @@ MeshInstanceEditor::MeshInstanceEditor() { options->set_text("Mesh"); options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshInstance","EditorIcons")); - options->get_popup()->add_item("Create Trimesh Static Body",MENU_OPTION_CREATE_STATIC_TRIMESH_BODY); - options->get_popup()->add_item("Create Convex Static Body",MENU_OPTION_CREATE_STATIC_CONVEX_BODY); + options->get_popup()->add_item(TTR("Create Trimesh Static Body"),MENU_OPTION_CREATE_STATIC_TRIMESH_BODY); + options->get_popup()->add_item(TTR("Create Convex Static Body"),MENU_OPTION_CREATE_STATIC_CONVEX_BODY); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Trimesh Collision Sibling",MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE); - options->get_popup()->add_item("Create Convex Collision Sibling",MENU_OPTION_CREATE_CONVEX_COLLISION_SHAPE); + options->get_popup()->add_item(TTR("Create Trimesh Collision Sibling"),MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE); + options->get_popup()->add_item(TTR("Create Convex Collision Sibling"),MENU_OPTION_CREATE_CONVEX_COLLISION_SHAPE); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Navigation Mesh",MENU_OPTION_CREATE_NAVMESH); + options->get_popup()->add_item(TTR("Create Navigation Mesh"),MENU_OPTION_CREATE_NAVMESH); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Outline Mesh..",MENU_OPTION_CREATE_OUTLINE_MESH); + options->get_popup()->add_item(TTR("Create Outline Mesh.."),MENU_OPTION_CREATE_OUTLINE_MESH); options->get_popup()->connect("item_pressed", this,"_menu_option"); outline_dialog = memnew( ConfirmationDialog ); - outline_dialog->set_title("Create Outline Mesh"); - outline_dialog->get_ok()->set_text("Create"); + outline_dialog->set_title(TTR("Create Outline Mesh")); + outline_dialog->get_ok()->set_text(TTR("Create")); VBoxContainer *outline_dialog_vbc = memnew( VBoxContainer ); outline_dialog->add_child(outline_dialog_vbc); @@ -250,7 +250,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_size->set_max(1024); outline_size->set_step(0.001); outline_size->set_val(0.05); - outline_dialog_vbc->add_margin_child("Outline Size:",outline_size); + outline_dialog_vbc->add_margin_child(TTR("Outline Size:"),outline_size); add_child(outline_dialog); outline_dialog->connect("confirmed",this,"_create_outline_mesh"); diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index 15df9a6262..e22dfb3d13 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -55,13 +55,13 @@ void MultiMeshEditor::_populate() { multimesh = node->get_multimesh(); if (multimesh.is_null()) { - err_dialog->set_text("No mesh source specified (and no MultiMesh set in node)."); + err_dialog->set_text(TTR("No mesh source specified (and no MultiMesh set in node).")); err_dialog->popup_centered_minsize(); return; } if (multimesh->get_mesh().is_null()) { - err_dialog->set_text("No mesh source specified (and MultiMesh contains no Mesh)."); + err_dialog->set_text(TTR("No mesh source specified (and MultiMesh contains no Mesh).")); err_dialog->popup_centered_minsize(); return; } @@ -73,7 +73,7 @@ void MultiMeshEditor::_populate() { if (!ms_node) { - err_dialog->set_text("Mesh source is invalid (Invalid Path)."); + err_dialog->set_text(TTR("Mesh source is invalid (Invalid Path).")); err_dialog->popup_centered_minsize(); return; } @@ -82,7 +82,7 @@ void MultiMeshEditor::_populate() { if (!ms_instance) { - err_dialog->set_text("Mesh source is invalid (Not a MeshInstance)."); + err_dialog->set_text(TTR("Mesh source is invalid (Not a MeshInstance).")); err_dialog->popup_centered_minsize(); return; } @@ -91,7 +91,7 @@ void MultiMeshEditor::_populate() { if (mesh.is_null()) { - err_dialog->set_text("Mesh source is invalid (Contains no Mesh resource)."); + err_dialog->set_text(TTR("Mesh source is invalid (Contains no Mesh resource).")); err_dialog->popup_centered_minsize(); return; } @@ -100,7 +100,7 @@ void MultiMeshEditor::_populate() { if (surface_source->get_text()=="") { - err_dialog->set_text("No surface source specified."); + err_dialog->set_text(TTR("No surface source specified.")); err_dialog->popup_centered_minsize(); return; } @@ -109,7 +109,7 @@ void MultiMeshEditor::_populate() { if (!ss_node) { - err_dialog->set_text("Surface source is invalid (Invalid Path)."); + err_dialog->set_text(TTR("Surface source is invalid (Invalid Path).")); err_dialog->popup_centered_minsize(); return; } @@ -118,7 +118,7 @@ void MultiMeshEditor::_populate() { if (!ss_instance) { - err_dialog->set_text("Surface source is invalid (Not Geometry)."); + err_dialog->set_text(TTR("Surface source is invalid (Not Geometry).")); err_dialog->popup_centered_minsize(); return; } @@ -129,7 +129,7 @@ void MultiMeshEditor::_populate() { if (geometry.size()==0) { - err_dialog->set_text("Surface source is invalid (No Faces)."); + err_dialog->set_text(TTR("Surface source is invalid (No Faces).")); err_dialog->popup_centered_minsize(); return; } @@ -153,10 +153,10 @@ void MultiMeshEditor::_populate() { node->populate_parent(populate_rotate_random->get_val(),populate_tilt_random->get_val(),populate_scale_random->get_val(),populate_scale->get_val()); - ERR_EXPLAIN("Parent is not of type VisualInstance."); + ERR_EXPLAIN(TTR("Parent is not of type VisualInstance.")); ERR_FAIL_COND(!get_parent() || !get_parent()->is_type("VisualInstance")); - ERR_EXPLAIN("Multimesh not present"); + ERR_EXPLAIN(TTR("Multimesh not present")); ERR_FAIL_COND(multimesh.is_null()); VisualInstance *vi = get_parent()->cast_to<VisualInstance>(); @@ -165,7 +165,7 @@ void MultiMeshEditor::_populate() { #endif DVector<Face3> faces = geometry; - ERR_EXPLAIN("Parent has no solid faces to populate."); + ERR_EXPLAIN(TTR("Parent has no solid faces to populate.")); int facecount=faces.size(); ERR_FAIL_COND(!facecount); @@ -184,9 +184,9 @@ void MultiMeshEditor::_populate() { area_accum+=area; } - ERR_EXPLAIN("Couldn't map area"); + ERR_EXPLAIN(TTR("Couldn't map area")); ERR_FAIL_COND(triangle_area_map.size()==0); - ERR_EXPLAIN("Couldn't map area"); + ERR_EXPLAIN(TTR("Couldn't map area")); ERR_FAIL_COND(area_accum==0); @@ -308,9 +308,9 @@ void MultiMeshEditor::_browse(bool p_source) { std->get_scene_tree()->set_marked(node,false); std->popup_centered_ratio(); if (p_source) - std->set_title("Select a Source Mesh:"); + std->set_title(TTR("Select a Source Mesh:")); else - std->set_title("Select a Target Surface:"); + std->set_title(TTR("Select a Target Surface:")); } void MultiMeshEditor::_bind_methods() { @@ -330,11 +330,11 @@ MultiMeshEditor::MultiMeshEditor() { options->set_text("MultiMesh"); options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance","EditorIcons")); - options->get_popup()->add_item("Populate Surface"); + options->get_popup()->add_item(TTR("Populate Surface")); options->get_popup()->connect("item_pressed", this,"_menu_option"); populate_dialog = memnew( ConfirmationDialog ); - populate_dialog->set_title("Populate MultiMesh"); + populate_dialog->set_title(TTR("Populate MultiMesh")); add_child(populate_dialog); VBoxContainer *vbc = memnew( VBoxContainer ); @@ -351,7 +351,7 @@ MultiMeshEditor::MultiMeshEditor() { b->set_text(".."); b->connect("pressed",this,"_browse",make_binds(false)); - vbc->add_margin_child("Target Surface:",hbc); + vbc->add_margin_child(TTR("Target Surface:"),hbc); hbc = memnew( HBoxContainer ); mesh_source = memnew( LineEdit ); @@ -360,26 +360,26 @@ MultiMeshEditor::MultiMeshEditor() { b = memnew( Button ); hbc->add_child(b); b->set_text(".."); - vbc->add_margin_child("Source Mesh:",hbc); + vbc->add_margin_child(TTR("Source Mesh:"),hbc); b->connect("pressed",this,"_browse",make_binds(true)); populate_axis = memnew( OptionButton ); - populate_axis->add_item("X-Axis"); - populate_axis->add_item("Y-Axis"); - populate_axis->add_item("Z-Axis"); + populate_axis->add_item(TTR("X-Axis")); + populate_axis->add_item(TTR("Y-Axis")); + populate_axis->add_item(TTR("Z-Axis")); populate_axis->select(2); - vbc->add_margin_child("Mesh Up Axis:",populate_axis); + vbc->add_margin_child(TTR("Mesh Up Axis:"),populate_axis); populate_rotate_random = memnew( HSlider ); populate_rotate_random->set_max(1); populate_rotate_random->set_step(0.01); - vbc->add_margin_child("Random Rotation:",populate_rotate_random); + vbc->add_margin_child(TTR("Random Rotation:"),populate_rotate_random); populate_tilt_random = memnew( HSlider ); populate_tilt_random->set_max(1); populate_tilt_random->set_step(0.01); - vbc->add_margin_child("Random Tilt:",populate_tilt_random); + vbc->add_margin_child(TTR("Random Tilt:"),populate_tilt_random); populate_scale_random = memnew( SpinBox ); @@ -387,14 +387,14 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale_random->set_max(1); populate_scale_random->set_val(0); - vbc->add_margin_child("Random Scale:",populate_scale_random); + vbc->add_margin_child(TTR("Random Scale:"),populate_scale_random); populate_scale = memnew( SpinBox ); populate_scale->set_min(0.001); populate_scale->set_max(4096); populate_scale->set_val(1); - vbc->add_margin_child("Scale:",populate_scale); + vbc->add_margin_child(TTR("Scale:"),populate_scale); populate_amount = memnew( SpinBox ); @@ -404,9 +404,9 @@ MultiMeshEditor::MultiMeshEditor() { populate_amount->set_min(1); populate_amount->set_max(65536); populate_amount->set_val(128); - vbc->add_margin_child("Amount:",populate_amount); + vbc->add_margin_child(TTR("Amount:"),populate_amount); - populate_dialog->get_ok()->set_text("Populate"); + populate_dialog->get_ok()->set_text(TTR("Populate")); populate_dialog->get_ok()->connect("pressed", this,"_populate"); std = memnew( SceneTreeDialog ); diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp index fa1f614413..038c1d48a7 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -39,7 +39,7 @@ void NavigationPolygonEditor::_create_nav() { if (!node) return; - undo_redo->create_action("Create Navigation Polygon"); + undo_redo->create_action(TTR("Create Navigation Polygon")); undo_redo->add_do_method(node,"set_navigation_polygon",Ref<NavigationPolygon>(memnew( NavigationPolygon))); undo_redo->add_undo_method(node,"set_navigation_polygon",Variant(REF())); undo_redo->commit_action(); @@ -70,7 +70,7 @@ void NavigationPolygonEditor::_wip_close() { if (wip.size()>=3) { - undo_redo->create_action("Create Poly"); + undo_redo->create_action(TTR("Create Poly")); undo_redo->add_undo_method(node->get_navigation_polygon().ptr(),"remove_outline",node->get_navigation_polygon()->get_outline_count()); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"add_outline",wip); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"make_polygons_from_outlines"); @@ -271,7 +271,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline); ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly.set(edited_point,edited_point_pos); - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"set_outline",edited_outline,poly); undo_redo->add_undo_method(node->get_navigation_polygon().ptr(),"set_outline",edited_outline,pre_move_edit); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"make_polygons_from_outlines"); @@ -320,7 +320,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline); if (poly.size()>3) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node->get_navigation_polygon().ptr(),"set_outline",closest_outline,poly); poly.remove(closest_idx); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"set_outline",closest_outline,poly); @@ -331,7 +331,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { undo_redo->commit_action(); } else { - undo_redo->create_action("Remove Poly And Point"); + undo_redo->create_action(TTR("Remove Poly And Point")); undo_redo->add_undo_method(node->get_navigation_polygon().ptr(),"add_outline_at_index",poly,closest_outline); poly.remove(closest_idx); undo_redo->add_do_method(node->get_navigation_polygon().ptr(),"remove_outline",closest_outline); @@ -469,7 +469,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { add_child(button_create); button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE)); button_create->set_toggle_mode(true); - button_create->set_tooltip("Create a new polygon from scratch"); + button_create->set_tooltip(TTR("Create a new polygon from scratch")); button_edit = memnew( ToolButton ); add_child(button_edit); @@ -478,7 +478,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { button_edit->set_tooltip("Edit existing polygon:\nLMB: Move Point.\nCtrl+LMB: Split Segment.\nRMB: Erase Point."); create_nav = memnew( ConfirmationDialog ); add_child(create_nav); - create_nav->get_ok()->set_text("Create"); + create_nav->get_ok()->set_text(TTR("Create")); //add_constant_override("separation",0); @@ -487,8 +487,8 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp index 297145f408..8892950feb 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp @@ -66,7 +66,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { Image img; Error err = ImageLoader::load_image(p_file,&img); - ERR_EXPLAIN("Error loading image: "+p_file); + ERR_EXPLAIN(TTR("Error loading image: ")+p_file); ERR_FAIL_COND(err!=OK); img.convert(Image::FORMAT_GRAYSCALE_ALPHA); @@ -92,7 +92,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { valid_positions.resize(vpc); - ERR_EXPLAIN("No pixels with transparency > 128 in image.."); + ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image..")); ERR_FAIL_COND(valid_positions.size()==0); DVector<Point2> epoints; @@ -110,7 +110,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { w = DVector<Point2>::Write(); - undo_redo->create_action("Set Emission Mask"); + undo_redo->create_action(TTR("Set Emission Mask")); undo_redo->add_do_method(particles,"set_emission_points",epoints); undo_redo->add_do_method(particles,"set_emission_half_extents",extents); undo_redo->add_undo_method(particles,"set_emission_points",particles->get_emission_points()); @@ -130,7 +130,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { } break; case MENU_CLEAR_EMISSION_MASK: { - undo_redo->create_action("Clear Emission Mask"); + undo_redo->create_action(TTR("Clear Emission Mask")); undo_redo->add_do_method(particles,"set_emission_points",DVector<Vector2>()); undo_redo->add_undo_method(particles,"set_emission_points",particles->get_emission_points()); undo_redo->commit_action(); @@ -171,8 +171,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { toolbar->add_child( memnew( VSeparator ) ); menu = memnew( MenuButton ); - menu->get_popup()->add_item("Load Emission Mask",MENU_LOAD_EMISSION_MASK); - menu->get_popup()->add_item("Clear Emission Mask",MENU_CLEAR_EMISSION_MASK); + 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"); toolbar->add_child(menu); @@ -190,7 +190,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { epoints->set_max(8192); epoints->set_step(1); epoints->set_val(512); - file->get_vbox()->add_margin_child("Generated Point Count:",epoints); + file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints); } Particles2DEditorPlugin::~Particles2DEditorPlugin() diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp index 2df6d3ea90..b7ba987622 100644 --- a/tools/editor/plugins/particles_editor_plugin.cpp +++ b/tools/editor/plugins/particles_editor_plugin.cpp @@ -57,7 +57,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){ VisualInstance *vi = sel->cast_to<VisualInstance>(); if (!vi) { - err_dialog->set_text("Node does not contain geometry."); + err_dialog->set_text(TTR("Node does not contain geometry.")); err_dialog->popup_centered_minsize(); return; } @@ -66,7 +66,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){ if (geometry.size()==0) { - err_dialog->set_text("Node does not contain geometry (faces)."); + err_dialog->set_text(TTR("Node does not contain geometry (faces).")); err_dialog->popup_centered_minsize(); return; @@ -219,7 +219,7 @@ void ParticlesEditor::_generate_emission_points() { if (!triangle_area_map.size() || area_accum==0) { - err_dialog->set_text("Faces contain no area!"); + err_dialog->set_text(TTR("Faces contain no area!")); err_dialog->popup_centered_minsize(); return; } @@ -249,7 +249,7 @@ void ParticlesEditor::_generate_emission_points() { if (gcount==0) { - err_dialog->set_text("No Faces!"); + err_dialog->set_text(TTR("No Faces!")); err_dialog->popup_centered_minsize(); return; } @@ -349,20 +349,20 @@ ParticlesEditor::ParticlesEditor() { particles_editor_hb->hide(); options->set_text("Particles"); - options->get_popup()->add_item("Generate AABB",MENU_OPTION_GENERATE_AABB); + options->get_popup()->add_item(TTR("Generate AABB"),MENU_OPTION_GENERATE_AABB); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Emitter From Mesh",MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH); - options->get_popup()->add_item("Create Emitter From Node",MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); - options->get_popup()->add_item("Clear Emitter",MENU_OPTION_CLEAR_EMISSION_VOLUME); + options->get_popup()->add_item(TTR("Create Emitter From Mesh"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_MESH); + options->get_popup()->add_item(TTR("Create Emitter From Node"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); + options->get_popup()->add_item(TTR("Clear Emitter"),MENU_OPTION_CLEAR_EMISSION_VOLUME); options->get_popup()->connect("item_pressed", this,"_menu_option"); emission_dialog = memnew( ConfirmationDialog ); - emission_dialog->set_title("Create Emitter"); + emission_dialog->set_title(TTR("Create Emitter")); add_child(emission_dialog); Label *l = memnew(Label); l->set_pos(Point2(5,5)); - l->set_text("Emission Positions:"); + l->set_text(TTR("Emission Positions:")); emission_dialog->add_child(l); @@ -374,20 +374,20 @@ ParticlesEditor::ParticlesEditor() { emission_amount->set_max(65536); emission_amount->set_val(512); emission_dialog->add_child(emission_amount); - emission_dialog->get_ok()->set_text("Create"); + emission_dialog->get_ok()->set_text(TTR("Create")); emission_dialog->connect("confirmed",this,"_generate_emission_points"); l = memnew(Label); l->set_pos(Point2(5,50)); - l->set_text("Emission Fill:"); + l->set_text(TTR("Emission Fill:")); emission_dialog->add_child(l); emission_fill = memnew( OptionButton ); emission_fill->set_anchor(MARGIN_RIGHT,ANCHOR_END); emission_fill->set_begin( Point2(20,70)); emission_fill->set_end( Point2(5,75)); - emission_fill->add_item("Surface"); - emission_fill->add_item("Volume"); + emission_fill->add_item(TTR("Surface")); + emission_fill->add_item(TTR("Volume")); emission_dialog->add_child(emission_fill); err_dialog = memnew( ConfirmationDialog ); diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 509edbe5f8..079ca3a339 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -113,7 +113,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { return true; } else if ((mb.button_index==BUTTON_RIGHT && mode==MODE_EDIT) || (mb.button_index==BUTTON_LEFT && mode==MODE_DELETE)) { - undo_redo->create_action("Remove Point from Curve"); + undo_redo->create_action(TTR("Remove Point from Curve")); undo_redo->add_do_method(curve.ptr(),"remove_point",i); undo_redo->add_undo_method(curve.ptr(),"add_point",curve->get_point_pos(i),curve->get_point_in(i),curve->get_point_out(i),i); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -162,7 +162,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { Ref<Curve2D> curve = node->get_curve(); - undo_redo->create_action("Add Point to Curve"); + undo_redo->create_action(TTR("Add Point to Curve")); undo_redo->add_do_method(curve.ptr(),"add_point",cpoint); undo_redo->add_undo_method(curve.ptr(),"remove_point",curve->get_point_count()); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -190,7 +190,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { case ACTION_MOVING_POINT: { - undo_redo->create_action("Move Point in Curve"); + undo_redo->create_action(TTR("Move Point in Curve")); undo_redo->add_do_method(curve.ptr(),"set_point_pos",action_point,cpoint); undo_redo->add_undo_method(curve.ptr(),"set_point_pos",action_point,moving_from); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -200,7 +200,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { } break; case ACTION_MOVING_IN: { - undo_redo->create_action("Move In-Control in Curve"); + undo_redo->create_action(TTR("Move In-Control in Curve")); undo_redo->add_do_method(curve.ptr(),"set_point_in",action_point,new_pos); undo_redo->add_undo_method(curve.ptr(),"set_point_in",action_point,moving_from); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -210,7 +210,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { } break; case ACTION_MOVING_OUT: { - undo_redo->create_action("Move Out-Control in Curve"); + undo_redo->create_action(TTR("Move Out-Control in Curve")); undo_redo->add_do_method(curve.ptr(),"set_point_out",action_point,new_pos); undo_redo->add_undo_method(curve.ptr(),"set_point_out",action_point,moving_from); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -280,7 +280,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { if (poly.size() < 3) { - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.push_back(cpoint); undo_redo->add_do_method(node,"set_polygon",poly); @@ -360,7 +360,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly[edited_point]=edited_point_pos; - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node,"set_polygon",poly); undo_redo->add_undo_method(node,"set_polygon",pre_move_edit); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -394,7 +394,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.remove(closest_idx); undo_redo->add_do_method(node,"set_polygon",poly); @@ -596,7 +596,7 @@ void Path2DEditor::_mode_selected(int p_mode) { if (begin.distance_to(end)<CMP_EPSILON) return; - undo_redo->create_action("Remove Point from Curve"); + undo_redo->create_action(TTR("Remove Point from Curve")); undo_redo->add_do_method(node->get_curve().ptr(),"add_point",begin); undo_redo->add_undo_method(node->get_curve().ptr(),"remove_point",node->get_curve()->get_point_count()); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -622,8 +622,8 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif @@ -643,7 +643,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { curve_edit_curve->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveCurve","EditorIcons")); curve_edit_curve->set_toggle_mode(true); curve_edit_curve->set_focus_mode(Control::FOCUS_NONE); - curve_edit_curve->set_tooltip("Select Control Points (Shift+Drag)"); + curve_edit_curve->set_tooltip(TTR("Select Control Points (Shift+Drag)")); curve_edit_curve->connect("pressed",this,"_mode_selected",varray(MODE_EDIT_CURVE)); base_hb->add_child(curve_edit_curve); curve_create = memnew( ToolButton ); @@ -657,13 +657,13 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { curve_del->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveDelete","EditorIcons")); curve_del->set_toggle_mode(true); curve_del->set_focus_mode(Control::FOCUS_NONE); - curve_del->set_tooltip("Delete Point."); + curve_del->set_tooltip(TTR("Delete Point.")); curve_del->connect("pressed",this,"_mode_selected",varray(MODE_DELETE)); base_hb->add_child(curve_del); curve_close = memnew( ToolButton ); curve_close->set_icon(CanvasItemEditor::get_singleton()->get_icon("CurveClose","EditorIcons")); curve_close->set_focus_mode(Control::FOCUS_NONE); - curve_close->set_tooltip("Close Curve"); + curve_close->set_tooltip(TTR("Close Curve")); curve_close->connect("pressed",this,"_mode_selected",varray(ACTION_CLOSE)); base_hb->add_child(curve_close); base_hb->hide(); diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index 3c4428bdb0..6820eed297 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -39,14 +39,14 @@ String PathSpatialGizmo::get_handle_name(int p_idx) const { if (p_idx<c->get_point_count()) { - return "Curve Point #"+itos(p_idx); + return TTR("Curve Point #")+itos(p_idx); } p_idx=p_idx-c->get_point_count()+1; int idx=p_idx/2; int t=p_idx%2; - String n = "Curve Point #"+itos(idx); + String n = TTR("Curve Point #")+itos(idx); if (t==0) n+=" In"; else @@ -148,7 +148,7 @@ void PathSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_c c->set_point_pos(p_idx,p_restore); return; } - ur->create_action("Set Curve Point Pos"); + ur->create_action(TTR("Set Curve Point Pos")); ur->add_do_method(c.ptr(),"set_point_pos",p_idx,c->get_point_pos(p_idx)); ur->add_undo_method(c.ptr(),"set_point_pos",p_idx,p_restore); ur->commit_action(); @@ -179,7 +179,7 @@ void PathSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_c c->set_point_in(p_idx,p_restore); return; } - ur->create_action("Set Curve In Pos"); + ur->create_action(TTR("Set Curve In Pos")); ur->add_do_method(c.ptr(),"set_point_in",idx,c->get_point_in(idx)); ur->add_undo_method(c.ptr(),"set_point_in",idx,p_restore); ur->commit_action(); @@ -191,7 +191,7 @@ void PathSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_c c->set_point_out(idx,p_restore); return; } - ur->create_action("Set Curve Out Pos"); + ur->create_action(TTR("Set Curve Out Pos")); ur->add_do_method(c.ptr(),"set_point_out",idx,c->get_point_out(idx)); ur->add_undo_method(c.ptr(),"set_point_out",idx,p_restore); ur->commit_action(); @@ -366,7 +366,7 @@ bool PathEditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputE if (closest_seg!=-1) { //subdivide - ur->create_action("Split Path"); + ur->create_action(TTR("Split Path")); ur->add_do_method(c.ptr(),"add_point",closest_seg_point,Vector3(),Vector3(),closest_seg+1); ur->add_undo_method(c.ptr(),"remove_point",closest_seg+1); ur->commit_action();; @@ -386,7 +386,7 @@ bool PathEditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputE Vector3 inters; if (p.intersects_ray(ray_from,ray_dir,&inters)) { - ur->create_action("Add Point to Curve"); + ur->create_action(TTR("Add Point to Curve")); ur->add_do_method(c.ptr(),"add_point",it.xform(inters),Vector3(),Vector3(),-1); ur->add_undo_method(c.ptr(),"remove_point",c->get_point_count()); ur->commit_action();; @@ -411,7 +411,7 @@ bool PathEditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputE if (erase_idx!=-1) { UndoRedo *ur = editor->get_undo_redo(); - ur->create_action("Remove Path Point"); + ur->create_action(TTR("Remove Path Point")); ur->add_do_method(c.ptr(),"remove_point",erase_idx); ur->add_undo_method(c.ptr(),"add_point",c->get_point_pos(erase_idx),c->get_point_in(erase_idx),c->get_point_out(erase_idx),erase_idx); ur->commit_action(); @@ -560,13 +560,13 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { curve_del->set_toggle_mode(true); curve_del->hide(); curve_del->set_focus_mode(Control::FOCUS_NONE); - curve_del->set_tooltip("Delete Point."); + curve_del->set_tooltip(TTR("Delete Point.")); SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_del); curve_close = memnew( ToolButton ); curve_close->set_icon(SpatialEditor::get_singleton()->get_icon("CurveClose","EditorIcons")); curve_close->hide(); curve_close->set_focus_mode(Control::FOCUS_NONE); - curve_close->set_tooltip("Close Curve"); + curve_close->set_tooltip(TTR("Close Curve")); SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_close); diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index 849fe82645..f07c43b8e4 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -105,7 +105,7 @@ void Polygon2DEditor::_menu_option(int p_option) { DVector<Vector2> points = node->get_polygon(); DVector<Vector2> uvs = node->get_uv(); if (uvs.size()!=points.size()) { - undo_redo->create_action("Create UV Map"); + undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_uv",points); undo_redo->add_undo_method(node,"set_uv",uvs); undo_redo->add_do_method(uv_edit_draw,"update"); @@ -123,7 +123,7 @@ void Polygon2DEditor::_menu_option(int p_option) { if (points.size()==0) break; DVector<Vector2> uvs = node->get_uv(); - undo_redo->create_action("Create UV Map"); + undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_uv",points); undo_redo->add_undo_method(node,"set_uv",uvs); undo_redo->add_do_method(uv_edit_draw,"update"); @@ -139,7 +139,7 @@ void Polygon2DEditor::_menu_option(int p_option) { if (uvs.size()==0) break; - undo_redo->create_action("Create UV Map"); + undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_polygon",uvs); undo_redo->add_undo_method(node,"set_polygon",points); undo_redo->add_do_method(uv_edit_draw,"update"); @@ -152,7 +152,7 @@ void Polygon2DEditor::_menu_option(int p_option) { DVector<Vector2> uvs = node->get_uv(); if (uvs.size()==0) break; - undo_redo->create_action("Create UV Map"); + undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_uv",DVector<Vector2>()); undo_redo->add_undo_method(node,"set_uv",uvs); undo_redo->add_do_method(uv_edit_draw,"update"); @@ -202,7 +202,7 @@ void Polygon2DEditor::_set_snap_step_y(float p_val) void Polygon2DEditor::_wip_close() { - undo_redo->create_action("Create Poly"); + undo_redo->create_action(TTR("Create Poly")); undo_redo->add_undo_method(node,"set_polygon",node->get_polygon()); undo_redo->add_do_method(node,"set_polygon",wip); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -294,7 +294,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { if (poly.size() < 3) { - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.push_back(cpoint); undo_redo->add_do_method(node,"set_polygon",poly); @@ -374,7 +374,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly[edited_point]=edited_point_pos-node->get_offset(); - undo_redo->create_action("Edit Poly"); + undo_redo->create_action(TTR("Edit Poly")); undo_redo->add_do_method(node,"set_polygon",poly); undo_redo->add_undo_method(node,"set_polygon",pre_move_edit); undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update"); @@ -408,7 +408,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { - undo_redo->create_action("Edit Poly (Remove Point)"); + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); undo_redo->add_undo_method(node,"set_polygon",poly); poly.remove(closest_idx); undo_redo->add_do_method(node,"set_polygon",poly); @@ -548,7 +548,7 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { } } else if (uv_drag) { - undo_redo->create_action("Transform UV Map"); + undo_redo->create_action(TTR("Transform UV Map")); undo_redo->add_do_method(node,"set_uv",node->get_uv()); undo_redo->add_undo_method(node,"set_uv",uv_prev); undo_redo->add_do_method(uv_edit_draw,"update"); @@ -840,8 +840,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { options = memnew( MenuButton ); add_child(options); options->set_area_as_parent_rect(); - options->set_text("Polygon"); - //options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); + options->set_text(TTR("Polygon")); + //options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); options->get_popup()->connect("item_pressed", this,"_menu_option"); #endif @@ -851,7 +851,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_mode=UV_MODE_EDIT_POINT; uv_edit = memnew( AcceptDialog ); add_child(uv_edit); - uv_edit->set_title("Polygon 2D UV Editor"); + uv_edit->set_title(TTR("Polygon 2D UV Editor")); uv_edit->set_self_opacity(0.9); VBoxContainer *uv_main_vb = memnew( VBoxContainer ); @@ -869,9 +869,9 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { } uv_button[0]->set_tooltip("Move Point\nCtrl: Rotate\nShift: Move All\n:Shift+Ctrl: Scale"); - uv_button[1]->set_tooltip("Move Polygon"); - uv_button[2]->set_tooltip("Rotate Polygon"); - uv_button[3]->set_tooltip("Scale Polygon"); + uv_button[1]->set_tooltip(TTR("Move Polygon")); + uv_button[2]->set_tooltip(TTR("Rotate Polygon")); + uv_button[3]->set_tooltip(TTR("Scale Polygon")); uv_button[0]->set_pressed(true); HBoxContainer *uv_main_hb = memnew( HBoxContainer ); @@ -882,35 +882,35 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_edit_draw->set_h_size_flags(SIZE_EXPAND_FILL); uv_menu = memnew( MenuButton ); uv_mode_hb->add_child(uv_menu); - uv_menu->set_text("Edit"); - uv_menu->get_popup()->add_item("Polygon->UV",UVEDIT_POLYGON_TO_UV); - uv_menu->get_popup()->add_item("UV->Polygon",UVEDIT_UV_TO_POLYGON); + uv_menu->set_text(TTR("Edit")); + uv_menu->get_popup()->add_item(TTR("Polygon->UV"),UVEDIT_POLYGON_TO_UV); + uv_menu->get_popup()->add_item(TTR("UV->Polygon"),UVEDIT_UV_TO_POLYGON); uv_menu->get_popup()->add_separator(); - uv_menu->get_popup()->add_item("Clear UV",UVEDIT_UV_CLEAR); + uv_menu->get_popup()->add_item(TTR("Clear UV"),UVEDIT_UV_CLEAR); uv_menu->get_popup()->connect("item_pressed",this,"_menu_option"); uv_mode_hb->add_child( memnew( VSeparator )); b_snap_enable = memnew( ToolButton ); uv_mode_hb->add_child(b_snap_enable); - b_snap_enable->set_text("Snap"); + b_snap_enable->set_text(TTR("Snap")); b_snap_enable->set_focus_mode(FOCUS_NONE); b_snap_enable->set_toggle_mode(true); b_snap_enable->set_pressed(use_snap); - b_snap_enable->set_tooltip("Enable Snap"); + b_snap_enable->set_tooltip(TTR("Enable Snap")); b_snap_enable->connect("toggled",this,"_set_use_snap"); b_snap_grid = memnew( ToolButton ); uv_mode_hb->add_child(b_snap_grid); - b_snap_grid->set_text("Grid"); + b_snap_grid->set_text(TTR("Grid")); b_snap_grid->set_focus_mode(FOCUS_NONE); b_snap_grid->set_toggle_mode(true); b_snap_grid->set_pressed(snap_show_grid); - b_snap_grid->set_tooltip("Show Grid"); + b_snap_grid->set_tooltip(TTR("Show Grid")); b_snap_grid->connect("toggled",this,"_set_show_grid"); uv_mode_hb->add_child( memnew( VSeparator )); - uv_mode_hb->add_child( memnew( Label("Grid Offset:") ) ); + uv_mode_hb->add_child( memnew( Label(TTR("Grid Offset:")) ) ); SpinBox *sb_off_x = memnew( SpinBox ); sb_off_x->set_min(-256); @@ -931,7 +931,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_mode_hb->add_child(sb_off_y); uv_mode_hb->add_child( memnew( VSeparator )); - uv_mode_hb->add_child( memnew( Label("Grid Step:") ) ); + uv_mode_hb->add_child( memnew( Label(TTR("Grid Step:")) ) ); SpinBox *sb_step_x = memnew( SpinBox ); sb_step_x->set_min(-256); diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp index 0459ed85bd..01bb82834d 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -70,10 +70,10 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths) resource = ResourceLoader::load(path); if (resource.is_null()) { - dialog->set_text("ERROR: Couldn't load resource!"); - dialog->set_title("Error!"); - //dialog->get_cancel()->set_text("Close"); - dialog->get_ok()->set_text("Close"); + dialog->set_text(TTR("ERROR: Couldn't load resource!")); + dialog->set_title(TTR("Error!")); + //dialog->get_cancel()->set_text(TTR("Close")); + dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess } @@ -87,7 +87,7 @@ void ResourcePreloaderEditor::_files_load_request(const Vector<String>& p_paths) name=basename+" "+itos(counter); } - undo_redo->create_action("Add Resource"); + undo_redo->create_action(TTR("Add Resource")); undo_redo->add_do_method(preloader,"add_resource",name,resource); undo_redo->add_undo_method(preloader,"remove_resource",name); undo_redo->add_do_method(this,"_update_library"); @@ -134,7 +134,7 @@ void ResourcePreloaderEditor::_item_edited() { } RES samp = preloader->get_resource(old_name); - undo_redo->create_action("Rename Resource"); + undo_redo->create_action(TTR("Rename Resource")); undo_redo->add_do_method(preloader,"remove_resource",old_name); undo_redo->add_do_method(preloader,"add_resource",new_name,samp); undo_redo->add_undo_method(preloader,"remove_resource",new_name); @@ -154,7 +154,7 @@ void ResourcePreloaderEditor::_delete_confirm_pressed() { return; String to_remove = tree->get_selected()->get_text(0); - undo_redo->create_action("Delete Resource"); + undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(preloader,"remove_resource",to_remove); undo_redo->add_undo_method(preloader,"add_resource",to_remove,preloader->get_resource(to_remove)); undo_redo->add_do_method(this,"_update_library"); @@ -167,10 +167,10 @@ void ResourcePreloaderEditor::_paste_pressed() { RES r=EditorSettings::get_singleton()->get_resource_clipboard(); if (!r.is_valid()) { - dialog->set_text("Resource clipboard is empty!"); - dialog->set_title("Error!"); - //dialog->get_cancel()->set_text("Close"); - dialog->get_ok()->set_text("Close"); + dialog->set_text(TTR("Resource clipboard is empty!")); + dialog->set_title(TTR("Error!")); + //dialog->get_cancel()->set_text(TTR("Close")); + dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess } @@ -188,7 +188,7 @@ void ResourcePreloaderEditor::_paste_pressed() { name=basename+" "+itos(counter); } - undo_redo->create_action("Paste Resource"); + undo_redo->create_action(TTR("Paste Resource")); undo_redo->add_do_method(preloader,"add_resource",name,r); undo_redo->add_undo_method(preloader,"remove_resource",name); undo_redo->add_do_method(this,"_update_library"); @@ -206,11 +206,11 @@ void ResourcePreloaderEditor::_delete_pressed() { _delete_confirm_pressed(); //it has undo.. why bother with a dialog.. /* - dialog->set_title("Confirm..."); - dialog->set_text("Remove Resource '"+tree->get_selected()->get_text(0)+"' ?"); - //dialog->get_cancel()->set_text("Cancel"); + dialog->set_title(TTR("Confirm...")); + dialog->set_text(TTR("Remove Resource '")+tree->get_selected()->get_text(0)+"' ?"); + //dialog->get_cancel()->set_text(TTR("Cancel")); //dialog->get_ok()->show(); - dialog->get_ok()->set_text("Remove"); + dialog->get_ok()->set_text(TTR("Remove")); dialog->popup_centered(Size2(300,60));*/ } @@ -302,7 +302,7 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { vbc->add_child(hbc); load = memnew( Button ); - load->set_tooltip("Load Resource"); + load->set_tooltip(TTR("Load Resource")); hbc->add_child(load); @@ -311,7 +311,7 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() { hbc->add_child(_delete); paste = memnew( Button ); - paste->set_text("Paste"); + paste->set_text(TTR("Paste")); hbc->add_child(paste); file = memnew( EditorFileDialog ); diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/tools/editor/plugins/rich_text_editor_plugin.cpp index 08374d6624..99d75dff1d 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.cpp +++ b/tools/editor/plugins/rich_text_editor_plugin.cpp @@ -106,9 +106,9 @@ RichTextEditor::RichTextEditor() { CanvasItemEditor::get_singleton()->add_control_to_menu_panel(options); options->set_area_as_parent_rect(); - options->set_text("RichText"); - options->get_popup()->add_item("Parse BBCODE",PARSE_BBCODE); - options->get_popup()->add_item("Clear",CLEAR); + options->set_text(TTR("RichText")); + options->get_popup()->add_item(TTR("Parse BBCODE"),PARSE_BBCODE); + options->get_popup()->add_item(TTR("Clear"),CLEAR); options->get_popup()->connect("item_pressed", this,"_menu_option"); file_dialog = memnew( EditorFileDialog ); diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/tools/editor/plugins/rich_text_editor_plugin.h index ae1d04be01..0196a30332 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.h +++ b/tools/editor/plugins/rich_text_editor_plugin.h @@ -77,7 +77,7 @@ class RichTextEditorPlugin : public EditorPlugin { public: - virtual String get_name() const { return "RichText"; } + virtual String get_name() const { return TTR("RichText"); } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index ffa39bd010..8c5036b424 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -328,7 +328,7 @@ void SampleEditor::_update_sample() { return; //bye or unsupported generate_preview_texture(sample,peakdisplay); - info_label->set_text("Length: "+itos(sample->get_length())+" frames ("+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+" s), "+(sample->get_format()==Sample::FORMAT_PCM16?"16 Bits, ":"8 bits, ")+(sample->is_stereo()?"Stereo.":"Mono.")); + info_label->set_text(TTR("Length: ")+itos(sample->get_length())+" frames ("+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+" s), "+(sample->get_format()==Sample::FORMAT_PCM16?"16 Bits, ":"8 bits, ")+(sample->is_stereo()?"Stereo.":"Mono.")); library->add_sample("default",sample); } diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index f15a2834ca..0ab45b45c4 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -53,7 +53,7 @@ void SampleLibraryEditor::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { load->set_icon( get_icon("Folder","EditorIcons") ); - load->set_tooltip("Open Sample File(s)"); + load->set_tooltip(TTR("Open Sample File(s)")); } if (p_what==NOTIFICATION_READY) { @@ -74,10 +74,10 @@ void SampleLibraryEditor::_file_load_request(const DVector<String>& p_path) { String path = p_path[i]; Ref<Sample> sample = ResourceLoader::load(path,"Sample"); if (sample.is_null()) { - dialog->set_text("ERROR: Couldn't load sample!"); - dialog->set_title("Error!"); - //dialog->get_cancel()->set_text("Close"); - dialog->get_ok()->set_text("Close"); + dialog->set_text(TTR("ERROR: Couldn't load sample!")); + dialog->set_title(TTR("Error!")); + //dialog->get_cancel()->set_text(TTR("Close")); + dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess } @@ -89,7 +89,7 @@ void SampleLibraryEditor::_file_load_request(const DVector<String>& p_path) { name=basename+"_"+itos(counter); } - undo_redo->create_action("Add Sample"); + undo_redo->create_action(TTR("Add Sample")); undo_redo->add_do_method(sample_library.operator->(),"add_sample",name,sample); undo_redo->add_undo_method(sample_library.operator->(),"remove_sample",name); undo_redo->add_do_method(this,"_update_library"); @@ -114,7 +114,7 @@ void SampleLibraryEditor::_button_pressed(Object *p_item,int p_column, int p_id) String btn_type; if(!is_playing) { is_playing = true; - btn_type = "Stop"; + btn_type = TTR("Stop"); player->play(name,true); last_sample_playing = p_item; set_process(true); @@ -123,11 +123,11 @@ void SampleLibraryEditor::_button_pressed(Object *p_item,int p_column, int p_id) if(last_sample_playing != p_item){ TreeItem *tl=last_sample_playing->cast_to<TreeItem>(); tl->set_button(p_column,0,get_icon("Play","EditorIcons")); - btn_type = "Stop"; + btn_type = TTR("Stop"); player->play(name,true); last_sample_playing = p_item; } else { - btn_type = "Play"; + btn_type = TTR("Play"); is_playing = false; } } @@ -169,7 +169,7 @@ void SampleLibraryEditor::_item_edited() { } Ref<Sample> samp = sample_library->get_sample(old_name); - undo_redo->create_action("Rename Sample"); + undo_redo->create_action(TTR("Rename Sample")); undo_redo->add_do_method(sample_library.operator->(),"remove_sample",old_name); undo_redo->add_do_method(sample_library.operator->(),"add_sample",new_name,samp); undo_redo->add_undo_method(sample_library.operator->(),"remove_sample",new_name); @@ -199,7 +199,7 @@ void SampleLibraryEditor::_delete_pressed() { return; String to_remove = tree->get_selected()->get_text(0); - undo_redo->create_action("Delete Sample"); + undo_redo->create_action(TTR("Delete Sample")); undo_redo->add_do_method(sample_library.operator->(),"remove_sample",to_remove); undo_redo->add_undo_method(sample_library.operator->(),"add_sample",to_remove,sample_library->get_sample(to_remove)); undo_redo->add_do_method(this,"_update_library"); @@ -248,7 +248,7 @@ void SampleLibraryEditor::_update_library() { ti->set_cell_mode(2,TreeItem::CELL_MODE_STRING); ti->set_editable(2,false); ti->set_selectable(2,false); - ti->set_text(2,String()+/*itos(smp->get_length())+" frames ("+String::num(smp->get_length()/(float)smp->get_mix_rate(),2)+" smp), "+*/(smp->get_format()==Sample::FORMAT_PCM16?"16 Bits, ":(smp->get_format()==Sample::FORMAT_PCM8?"8 bits, ":"IMA-ADPCM,"))+(smp->is_stereo()?"Stereo":"Mono")); + ti->set_text(2,String()+/*itos(smp->get_length())+" frames ("+String::num(smp->get_length()/(float)smp->get_mix_rate(),2)+" smp), "+*/(smp->get_format()==Sample::FORMAT_PCM16?"16 Bits, ":(smp->get_format()==Sample::FORMAT_PCM8?"8 bits, ":TTR("IMA-ADPCM,")))+(smp->is_stereo()?"Stereo":"Mono")); // Volume dB ti->set_cell_mode(3,TreeItem::CELL_MODE_RANGE); @@ -331,9 +331,9 @@ SampleLibraryEditor::SampleLibraryEditor() { tree->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,30); tree->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,5); tree->set_column_titles_visible(true); - tree->set_column_title(0,"Name"); - tree->set_column_title(1,"Preview"); - tree->set_column_title(2,"Format"); + tree->set_column_title(0,TTR("Name")); + tree->set_column_title(1,TTR("Preview")); + tree->set_column_title(2,TTR("Format")); tree->set_column_title(3,"dB"); tree->set_column_title(4,"Pitch"); tree->set_column_title(5,""); diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp index 3085ad87d8..fd6e800b42 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.cpp +++ b/tools/editor/plugins/sample_player_editor_plugin.cpp @@ -76,7 +76,7 @@ void SamplePlayerEditor::_stop() { return; node->call("stop_all"); - print_line("STOP ALL!!"); + print_line(TTR("STOP ALL!!")); stop->set_pressed(true); play->set_pressed(false); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 6515b9b69e..eaf08ca1c0 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -223,12 +223,12 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { add_child(vbc); set_child_rect(vbc); search_box = memnew( LineEdit ); - vbc->add_margin_child("Search:",search_box); + vbc->add_margin_child(TTR("Search:"),search_box); search_box->connect("text_changed",this,"_text_changed"); search_box->connect("input_event",this,"_sbox_input"); search_options = memnew( Tree ); - vbc->add_margin_child("Matches:",search_options,true); - get_ok()->set_text("Open"); + vbc->add_margin_child(TTR("Matches:"),search_options,true); + get_ok()->set_text(TTR("Open")); get_ok()->set_disabled(true); register_text_enter(search_box); set_hide_on_ok(false); @@ -2214,7 +2214,6 @@ void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) { p_layout->set_value("ScriptEditor","open_scripts",scripts); p_layout->set_value("ScriptEditor","open_help",helps); p_layout->set_value("ScriptEditor","split_offset",script_split->get_split_offset()); - } @@ -2400,82 +2399,82 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu = memnew( MenuButton ); menu_hb->add_child(file_menu); - file_menu->set_text("File"); - file_menu->get_popup()->add_item("New",FILE_NEW); - file_menu->get_popup()->add_item("Open",FILE_OPEN); + file_menu->set_text(TTR("File")); + file_menu->get_popup()->add_item(TTR("New"),FILE_NEW); + file_menu->get_popup()->add_item(TTR("Open"),FILE_OPEN); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item("Save",FILE_SAVE,KEY_MASK_ALT|KEY_MASK_CMD|KEY_S); - file_menu->get_popup()->add_item("Save As..",FILE_SAVE_AS); - file_menu->get_popup()->add_item("Save All",FILE_SAVE_ALL,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_S); + file_menu->get_popup()->add_item(TTR("Save"),FILE_SAVE,KEY_MASK_ALT|KEY_MASK_CMD|KEY_S); + file_menu->get_popup()->add_item(TTR("Save As.."),FILE_SAVE_AS); + file_menu->get_popup()->add_item(TTR("Save All"),FILE_SAVE_ALL,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_S); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item("History Prev",WINDOW_PREV,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_LEFT); - file_menu->get_popup()->add_item("History Next",WINDOW_NEXT,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_RIGHT); + file_menu->get_popup()->add_item(TTR("History Prev"),WINDOW_PREV,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_LEFT); + file_menu->get_popup()->add_item(TTR("History Next"),WINDOW_NEXT,KEY_MASK_CTRL|KEY_MASK_ALT|KEY_RIGHT); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_item("Close",FILE_CLOSE,KEY_MASK_CMD|KEY_W); + file_menu->get_popup()->add_item(TTR("Close"),FILE_CLOSE,KEY_MASK_CMD|KEY_W); file_menu->get_popup()->connect("item_pressed", this,"_menu_option"); edit_menu = memnew( MenuButton ); menu_hb->add_child(edit_menu); - edit_menu->set_text("Edit"); - edit_menu->get_popup()->add_item("Undo",EDIT_UNDO,KEY_MASK_CMD|KEY_Z); - edit_menu->get_popup()->add_item("Redo",EDIT_REDO,KEY_MASK_CMD|KEY_Y); + edit_menu->set_text(TTR("Edit")); + edit_menu->get_popup()->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD|KEY_Z); + edit_menu->get_popup()->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD|KEY_Y); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item("Cut",EDIT_CUT,KEY_MASK_CMD|KEY_X); - edit_menu->get_popup()->add_item("Copy",EDIT_COPY,KEY_MASK_CMD|KEY_C); - edit_menu->get_popup()->add_item("Paste",EDIT_PASTE,KEY_MASK_CMD|KEY_V); + edit_menu->get_popup()->add_item(TTR("Cut"),EDIT_CUT,KEY_MASK_CMD|KEY_X); + edit_menu->get_popup()->add_item(TTR("Copy"),EDIT_COPY,KEY_MASK_CMD|KEY_C); + edit_menu->get_popup()->add_item(TTR("Paste"),EDIT_PASTE,KEY_MASK_CMD|KEY_V); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item("Select All",EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); + edit_menu->get_popup()->add_item(TTR("Select All"),EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item("Move Up",EDIT_MOVE_LINE_UP,KEY_MASK_ALT|KEY_UP); - edit_menu->get_popup()->add_item("Move Down",EDIT_MOVE_LINE_DOWN,KEY_MASK_ALT|KEY_DOWN); - edit_menu->get_popup()->add_item("Indent Left",EDIT_INDENT_LEFT,KEY_MASK_ALT|KEY_LEFT); - edit_menu->get_popup()->add_item("Indent Right",EDIT_INDENT_RIGHT,KEY_MASK_ALT|KEY_RIGHT); - edit_menu->get_popup()->add_item("Toggle Comment",EDIT_TOGGLE_COMMENT,KEY_MASK_CMD|KEY_K); - edit_menu->get_popup()->add_item("Clone Down",EDIT_CLONE_DOWN,KEY_MASK_CMD|KEY_B); + edit_menu->get_popup()->add_item(TTR("Move Up"),EDIT_MOVE_LINE_UP,KEY_MASK_ALT|KEY_UP); + edit_menu->get_popup()->add_item(TTR("Move Down"),EDIT_MOVE_LINE_DOWN,KEY_MASK_ALT|KEY_DOWN); + edit_menu->get_popup()->add_item(TTR("Indent Left"),EDIT_INDENT_LEFT,KEY_MASK_ALT|KEY_LEFT); + edit_menu->get_popup()->add_item(TTR("Indent Right"),EDIT_INDENT_RIGHT,KEY_MASK_ALT|KEY_RIGHT); + edit_menu->get_popup()->add_item(TTR("Toggle Comment"),EDIT_TOGGLE_COMMENT,KEY_MASK_CMD|KEY_K); + edit_menu->get_popup()->add_item(TTR("Clone Down"),EDIT_CLONE_DOWN,KEY_MASK_CMD|KEY_B); edit_menu->get_popup()->add_separator(); #ifdef OSX_ENABLED - edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_CTRL|KEY_SPACE); + edit_menu->get_popup()->add_item(TTR("Complete Symbol"),EDIT_COMPLETE,KEY_MASK_CTRL|KEY_SPACE); #else - edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_CMD|KEY_SPACE); + edit_menu->get_popup()->add_item(TTR("Complete Symbol"),EDIT_COMPLETE,KEY_MASK_CMD|KEY_SPACE); #endif edit_menu->get_popup()->add_item("Trim Trailing Whitespace", EDIT_TRIM_TRAILING_WHITESAPCE, KEY_MASK_CTRL|KEY_MASK_ALT|KEY_T); - edit_menu->get_popup()->add_item("Auto Indent",EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I); + edit_menu->get_popup()->add_item(TTR("Auto Indent"),EDIT_AUTO_INDENT,KEY_MASK_CMD|KEY_I); edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); search_menu = memnew( MenuButton ); menu_hb->add_child(search_menu); - search_menu->set_text("Search"); - search_menu->get_popup()->add_item("Find..",SEARCH_FIND,KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item("Find Next",SEARCH_FIND_NEXT,KEY_F3); - search_menu->get_popup()->add_item("Replace..",SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); + search_menu->set_text(TTR("Search")); + search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); + search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); + search_menu->get_popup()->add_item(TTR("Replace.."),SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); search_menu->get_popup()->add_separator(); - search_menu->get_popup()->add_item("Goto Function..",SEARCH_LOCATE_FUNCTION,KEY_MASK_SHIFT|KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item("Goto Line..",SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_L); + search_menu->get_popup()->add_item(TTR("Goto Function.."),SEARCH_LOCATE_FUNCTION,KEY_MASK_SHIFT|KEY_MASK_CMD|KEY_F); + search_menu->get_popup()->add_item(TTR("Goto Line.."),SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_L); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); script_search_menu = memnew( MenuButton ); menu_hb->add_child(script_search_menu); - script_search_menu->set_text("Search"); - script_search_menu->get_popup()->add_item("Find..",SEARCH_FIND,KEY_MASK_CMD|KEY_F); - script_search_menu->get_popup()->add_item("Find Next",SEARCH_FIND_NEXT,KEY_F3); + script_search_menu->set_text(TTR("Search")); + script_search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); + script_search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); script_search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); script_search_menu->hide(); debug_menu = memnew( MenuButton ); menu_hb->add_child(debug_menu); - debug_menu->set_text("Debug"); - debug_menu->get_popup()->add_item("Toggle Breakpoint",DEBUG_TOGGLE_BREAKPOINT,KEY_F9); + debug_menu->set_text(TTR("Debug")); + debug_menu->get_popup()->add_item(TTR("Toggle Breakpoint"),DEBUG_TOGGLE_BREAKPOINT,KEY_F9); debug_menu->get_popup()->add_separator(); - debug_menu->get_popup()->add_item("Step Over",DEBUG_NEXT,KEY_F10); - debug_menu->get_popup()->add_item("Step Into",DEBUG_STEP,KEY_F11); + debug_menu->get_popup()->add_item(TTR("Step Over"),DEBUG_NEXT,KEY_F10); + debug_menu->get_popup()->add_item(TTR("Step Into"),DEBUG_STEP,KEY_F11); debug_menu->get_popup()->add_separator(); - debug_menu->get_popup()->add_item("Break",DEBUG_BREAK); - debug_menu->get_popup()->add_item("Continue",DEBUG_CONTINUE); + debug_menu->get_popup()->add_item(TTR("Break"),DEBUG_BREAK); + debug_menu->get_popup()->add_item(TTR("Continue"),DEBUG_CONTINUE); debug_menu->get_popup()->add_separator(); - //debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); - debug_menu->get_popup()->add_check_item("Keep Debugger Open",DEBUG_SHOW_KEEP_OPEN); + //debug_menu->get_popup()->add_check_item(TTR("Show Debugger"),DEBUG_SHOW); + debug_menu->get_popup()->add_check_item(TTR("Keep Debugger Open"),DEBUG_SHOW_KEEP_OPEN); debug_menu->get_popup()->connect("item_pressed", this,"_menu_option"); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); @@ -2487,11 +2486,11 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { #if 0 window_menu = memnew( MenuButton ); menu_hb->add_child(window_menu); - window_menu->set_text("Window"); - window_menu->get_popup()->add_item("Close",WINDOW_CLOSE,KEY_MASK_CMD|KEY_W); + window_menu->set_text(TTR("Window")); + window_menu->get_popup()->add_item(TTR("Close"),WINDOW_CLOSE,KEY_MASK_CMD|KEY_W); window_menu->get_popup()->add_separator(); - window_menu->get_popup()->add_item("Move Left",WINDOW_MOVE_LEFT,KEY_MASK_CMD|KEY_LEFT); - window_menu->get_popup()->add_item("Move Right",WINDOW_MOVE_RIGHT,KEY_MASK_CMD|KEY_RIGHT); + window_menu->get_popup()->add_item(TTR("Move Left"),WINDOW_MOVE_LEFT,KEY_MASK_CMD|KEY_LEFT); + window_menu->get_popup()->add_item(TTR("Move Right"),WINDOW_MOVE_RIGHT,KEY_MASK_CMD|KEY_RIGHT); window_menu->get_popup()->add_separator(); window_menu->get_popup()->connect("item_pressed", this,"_menu_option"); @@ -2499,8 +2498,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { help_menu = memnew( MenuButton ); menu_hb->add_child(help_menu); - help_menu->set_text("Help"); - help_menu->get_popup()->add_item("Contextual", HELP_CONTEXTUAL, KEY_MASK_SHIFT|KEY_F1); + help_menu->set_text(TTR("Help")); + help_menu->get_popup()->add_item(TTR("Contextual"), HELP_CONTEXTUAL, KEY_MASK_SHIFT|KEY_F1); help_menu->get_popup()->connect("item_pressed", this,"_menu_option"); menu_hb->add_spacer(); @@ -2517,22 +2516,22 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { menu_hb->add_spacer(); site_search = memnew( ToolButton ); - site_search->set_text("Tutorials"); + site_search->set_text(TTR("Tutorials")); site_search->connect("pressed",this,"_menu_option",varray(SEARCH_WEBSITE)); menu_hb->add_child(site_search); - site_search->set_tooltip("Open http://www.godotengine.org at tutorials section."); + site_search->set_tooltip(TTR("Open http://www.godotengine.org at tutorials section.")); class_search = memnew( ToolButton ); - class_search->set_text("Classes"); + class_search->set_text(TTR("Classes")); class_search->connect("pressed",this,"_menu_option",varray(SEARCH_CLASSES)); menu_hb->add_child(class_search); - class_search->set_tooltip("Search the class hierarchy."); + class_search->set_tooltip(TTR("Search the class hierarchy.")); help_search = memnew( ToolButton ); - help_search->set_text("Search Help"); + help_search->set_text(TTR("Search Help")); help_search->connect("pressed",this,"_menu_option",varray(SEARCH_HELP)); menu_hb->add_child(help_search); - help_search->set_tooltip("Search the reference documentation."); + help_search->set_tooltip(TTR("Search the reference documentation.")); menu_hb->add_child( memnew( VSeparator) ); @@ -2540,13 +2539,13 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_back->connect("pressed",this,"_history_back"); menu_hb->add_child(script_back); script_back->set_disabled(true); - script_back->set_tooltip("Go to previous edited document."); + script_back->set_tooltip(TTR("Go to previous edited document.")); script_forward = memnew( ToolButton ); script_forward->connect("pressed",this,"_history_forward"); menu_hb->add_child(script_forward); script_forward->set_disabled(true); - script_forward->set_tooltip("Go to next edited document."); + script_forward->set_tooltip(TTR("Go to next edited document.")); @@ -2560,7 +2559,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { erase_tab_confirm->connect("confirmed", this,"_close_current_tab"); script_create_dialog = memnew(ScriptCreateDialog); - script_create_dialog->set_title("Create Script"); + script_create_dialog->set_title(TTR("Create Script")); add_child(script_create_dialog); script_create_dialog->connect("script_created", this, "_script_created"); @@ -2586,9 +2585,9 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { disk_changed_list->set_v_size_flags(SIZE_EXPAND_FILL); disk_changed->connect("confirmed",this,"_reload_scripts"); - disk_changed->get_ok()->set_text("Reload"); + disk_changed->get_ok()->set_text(TTR("Reload")); - disk_changed->add_button("Resave",!OS::get_singleton()->get_swap_ok_cancel(),"resave"); + disk_changed->add_button(TTR("Resave"),!OS::get_singleton()->get_swap_ok_cancel(),"resave"); disk_changed->connect("custom_action",this,"_resave_scripts"); @@ -2604,7 +2603,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { quick_open->connect("goto_line",this,"_goto_script_line2"); - Button *db = EditorNode::get_singleton()->add_bottom_panel_item("Debugger",debugger); + Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"),debugger); debugger->set_tool_button(db); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index d1e892a513..3399114402 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -481,28 +481,28 @@ ShaderEditor::ShaderEditor() { edit_menu = memnew( MenuButton ); add_child(edit_menu); edit_menu->set_pos(Point2(5,-1)); - edit_menu->set_text("Edit"); - edit_menu->get_popup()->add_item("Undo",EDIT_UNDO,KEY_MASK_CMD|KEY_Z); - edit_menu->get_popup()->add_item("Redo",EDIT_REDO,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_Z); + edit_menu->set_text(TTR("Edit")); + edit_menu->get_popup()->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD|KEY_Z); + edit_menu->get_popup()->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD|KEY_MASK_SHIFT|KEY_Z); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item("Cut",EDIT_CUT,KEY_MASK_CMD|KEY_X); - edit_menu->get_popup()->add_item("Copy",EDIT_COPY,KEY_MASK_CMD|KEY_C); - edit_menu->get_popup()->add_item("Paste",EDIT_PASTE,KEY_MASK_CMD|KEY_V); + edit_menu->get_popup()->add_item(TTR("Cut"),EDIT_CUT,KEY_MASK_CMD|KEY_X); + edit_menu->get_popup()->add_item(TTR("Copy"),EDIT_COPY,KEY_MASK_CMD|KEY_C); + edit_menu->get_popup()->add_item(TTR("Paste"),EDIT_PASTE,KEY_MASK_CMD|KEY_V); edit_menu->get_popup()->add_separator(); - edit_menu->get_popup()->add_item("Select All",EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); + edit_menu->get_popup()->add_item(TTR("Select All"),EDIT_SELECT_ALL,KEY_MASK_CMD|KEY_A); edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); search_menu = memnew( MenuButton ); add_child(search_menu); search_menu->set_pos(Point2(38,-1)); - search_menu->set_text("Search"); - search_menu->get_popup()->add_item("Find..",SEARCH_FIND,KEY_MASK_CMD|KEY_F); - search_menu->get_popup()->add_item("Find Next",SEARCH_FIND_NEXT,KEY_F3); - search_menu->get_popup()->add_item("Replace..",SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); + search_menu->set_text(TTR("Search")); + search_menu->get_popup()->add_item(TTR("Find.."),SEARCH_FIND,KEY_MASK_CMD|KEY_F); + search_menu->get_popup()->add_item(TTR("Find Next"),SEARCH_FIND_NEXT,KEY_F3); + search_menu->get_popup()->add_item(TTR("Replace.."),SEARCH_REPLACE,KEY_MASK_CMD|KEY_R); search_menu->get_popup()->add_separator(); -// search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); - search_menu->get_popup()->add_item("Goto Line..",SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_G); +// search_menu->get_popup()->add_item(TTR("Locate Symbol.."),SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); + search_menu->get_popup()->add_item(TTR("Goto Line.."),SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_G); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); @@ -521,15 +521,15 @@ ShaderEditor::ShaderEditor() { vertex_editor = memnew( ShaderTextEditor ); tab_container->add_child(vertex_editor); - vertex_editor->set_name("Vertex"); + vertex_editor->set_name(TTR("Vertex")); fragment_editor = memnew( ShaderTextEditor ); tab_container->add_child(fragment_editor); - fragment_editor->set_name("Fragment"); + fragment_editor->set_name(TTR("Fragment")); light_editor = memnew( ShaderTextEditor ); tab_container->add_child(light_editor); - light_editor->set_name("Lighting"); + light_editor->set_name(TTR("Lighting")); tab_container->set_current_tab(1); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 36a8c79b84..f618f41cf8 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -674,7 +674,7 @@ GraphCurveMapEdit::GraphCurveMapEdit(){ void ShaderGraphView::_scalar_const_changed(double p_value,int p_id) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Scalar Constant",true); + ur->create_action(TTR("Change Scalar Constant"),true); ur->add_do_method(graph.ptr(),"scalar_const_node_set_value",type,p_id,p_value); ur->add_undo_method(graph.ptr(),"scalar_const_node_set_value",type,p_id,graph->scalar_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -692,7 +692,7 @@ void ShaderGraphView::_vec_const_changed(double p_value, int p_id,Array p_arr){ } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Vec Constant",true); + ur->create_action(TTR("Change Vec Constant"),true); ur->add_do_method(graph.ptr(),"vec_const_node_set_value",type,p_id,val); ur->add_undo_method(graph.ptr(),"vec_const_node_set_value",type,p_id,graph->vec_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -705,7 +705,7 @@ void ShaderGraphView::_vec_const_changed(double p_value, int p_id,Array p_arr){ void ShaderGraphView::_rgb_const_changed(const Color& p_color, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change RGB Constant",true); + ur->create_action(TTR("Change RGB Constant"),true); ur->add_do_method(graph.ptr(),"rgb_const_node_set_value",type,p_id,p_color); ur->add_undo_method(graph.ptr(),"rgb_const_node_set_value",type,p_id,graph->rgb_const_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -718,7 +718,7 @@ void ShaderGraphView::_rgb_const_changed(const Color& p_color, int p_id){ void ShaderGraphView::_scalar_op_changed(int p_op, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Scalar Operator"); + ur->create_action(TTR("Change Scalar Operator")); ur->add_do_method(graph.ptr(),"scalar_op_node_set_op",type,p_id,p_op); ur->add_undo_method(graph.ptr(),"scalar_op_node_set_op",type,p_id,graph->scalar_op_node_get_op(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -731,7 +731,7 @@ void ShaderGraphView::_scalar_op_changed(int p_op, int p_id){ void ShaderGraphView::_vec_op_changed(int p_op, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Vec Operator"); + ur->create_action(TTR("Change Vec Operator")); ur->add_do_method(graph.ptr(),"vec_op_node_set_op",type,p_id,p_op); ur->add_undo_method(graph.ptr(),"vec_op_node_set_op",type,p_id,graph->vec_op_node_get_op(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -743,7 +743,7 @@ void ShaderGraphView::_vec_op_changed(int p_op, int p_id){ void ShaderGraphView::_vec_scalar_op_changed(int p_op, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change VecxScalar Operator"); + ur->create_action(TTR("Change VecxScalar Operator")); ur->add_do_method(graph.ptr(),"vec_scalar_op_node_set_op",type,p_id,p_op); ur->add_undo_method(graph.ptr(),"vec_scalar_op_node_set_op",type,p_id,graph->vec_scalar_op_node_get_op(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -756,7 +756,7 @@ void ShaderGraphView::_vec_scalar_op_changed(int p_op, int p_id){ void ShaderGraphView::_rgb_op_changed(int p_op, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change RGB Operator"); + ur->create_action(TTR("Change RGB Operator")); ur->add_do_method(graph.ptr(),"rgb_op_node_set_op",type,p_id,p_op); ur->add_undo_method(graph.ptr(),"rgb_op_node_set_op",type,p_id,graph->rgb_op_node_get_op(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -768,7 +768,7 @@ void ShaderGraphView::_rgb_op_changed(int p_op, int p_id){ void ShaderGraphView::_xform_inv_rev_changed(bool p_enabled, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Toggle Rot Only"); + ur->create_action(TTR("Toggle Rot Only")); ur->add_do_method(graph.ptr(),"xform_vec_mult_node_set_no_translation",type,p_id,p_enabled); ur->add_undo_method(graph.ptr(),"xform_vec_mult_node_set_no_translation",type,p_id,graph->xform_vec_mult_node_get_no_translation(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -781,7 +781,7 @@ void ShaderGraphView::_scalar_func_changed(int p_func, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Scalar Function"); + ur->create_action(TTR("Change Scalar Function")); ur->add_do_method(graph.ptr(),"scalar_func_node_set_function",type,p_id,p_func); ur->add_undo_method(graph.ptr(),"scalar_func_node_set_function",type,p_id,graph->scalar_func_node_get_function(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -793,7 +793,7 @@ void ShaderGraphView::_scalar_func_changed(int p_func, int p_id){ void ShaderGraphView::_vec_func_changed(int p_func, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Vec Function"); + ur->create_action(TTR("Change Vec Function")); ur->add_do_method(graph.ptr(),"vec_func_node_set_function",type,p_id,p_func); ur->add_undo_method(graph.ptr(),"vec_func_node_set_function",type,p_id,graph->vec_func_node_get_function(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -806,7 +806,7 @@ void ShaderGraphView::_vec_func_changed(int p_func, int p_id){ void ShaderGraphView::_scalar_input_changed(double p_value,int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Scalar Uniform",true); + ur->create_action(TTR("Change Scalar Uniform"),true); ur->add_do_method(graph.ptr(),"scalar_input_node_set_value",type,p_id,p_value); ur->add_undo_method(graph.ptr(),"scalar_input_node_set_value",type,p_id,graph->scalar_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -824,7 +824,7 @@ void ShaderGraphView::_vec_input_changed(double p_value, int p_id,Array p_arr){ } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Vec Uniform",true); + ur->create_action(TTR("Change Vec Uniform"),true); ur->add_do_method(graph.ptr(),"vec_input_node_set_value",type,p_id,val); ur->add_undo_method(graph.ptr(),"vec_input_node_set_value",type,p_id,graph->vec_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -862,7 +862,7 @@ void ShaderGraphView::_rgb_input_changed(const Color& p_color, int p_id){ UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change RGB Uniform",true); + ur->create_action(TTR("Change RGB Uniform"),true); ur->add_do_method(graph.ptr(),"rgb_input_node_set_value",type,p_id,p_color); ur->add_undo_method(graph.ptr(),"rgb_input_node_set_value",type,p_id,graph->rgb_input_node_get_value(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -902,7 +902,7 @@ void ShaderGraphView::_variant_edited() { break; } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change default value"); + ur->create_action(TTR("Change default value")); ur->add_do_method(graph.ptr(),"default_set_value",type,edited_id,edited_def, v); ur->add_undo_method(graph.ptr(),"default_set_value",type,edited_id,edited_def, v2); ur->add_do_method(this,"_update_graph"); @@ -914,7 +914,7 @@ void ShaderGraphView::_variant_edited() { if (graph->node_get_type(type,edited_id)==ShaderGraph::NODE_XFORM_CONST) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change XForm Uniform"); + ur->create_action(TTR("Change XForm Uniform")); ur->add_do_method(graph.ptr(),"xform_const_node_set_value",type,edited_id,ped_popup->get_variant()); ur->add_undo_method(graph.ptr(),"xform_const_node_set_value",type,edited_id,graph->xform_const_node_get_value(type,edited_id)); ur->add_do_method(this,"_update_graph"); @@ -926,7 +926,7 @@ void ShaderGraphView::_variant_edited() { if (graph->node_get_type(type,edited_id)==ShaderGraph::NODE_XFORM_INPUT) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change XForm Uniform"); + ur->create_action(TTR("Change XForm Uniform")); ur->add_do_method(graph.ptr(),"xform_input_node_set_value",type,edited_id,ped_popup->get_variant()); ur->add_undo_method(graph.ptr(),"xform_input_node_set_value",type,edited_id,graph->xform_input_node_get_value(type,edited_id)); ur->add_do_method(this,"_update_graph"); @@ -937,7 +937,7 @@ void ShaderGraphView::_variant_edited() { if (graph->node_get_type(type,edited_id)==ShaderGraph::NODE_TEXTURE_INPUT) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Texture Uniform"); + ur->create_action(TTR("Change Texture Uniform")); ur->add_do_method(graph.ptr(),"texture_input_node_set_value",type,edited_id,ped_popup->get_variant()); ur->add_undo_method(graph.ptr(),"texture_input_node_set_value",type,edited_id,graph->texture_input_node_get_value(type,edited_id)); ur->add_do_method(this,"_update_graph"); @@ -948,7 +948,7 @@ void ShaderGraphView::_variant_edited() { if (graph->node_get_type(type,edited_id)==ShaderGraph::NODE_CUBEMAP_INPUT) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Cubemap Uniform"); + ur->create_action(TTR("Change Cubemap Uniform")); ur->add_do_method(graph.ptr(),"cubemap_input_node_set_value",type,edited_id,ped_popup->get_variant()); ur->add_undo_method(graph.ptr(),"cubemap_input_node_set_value",type,edited_id,graph->cubemap_input_node_get_value(type,edited_id)); ur->add_do_method(this,"_update_graph"); @@ -962,7 +962,7 @@ void ShaderGraphView::_comment_edited(int p_id,Node* p_button) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); TextEdit *te=p_button->cast_to<TextEdit>(); - ur->create_action("Change Comment",true); + ur->create_action(TTR("Change Comment"),true); ur->add_do_method(graph.ptr(),"comment_node_set_text",type,p_id,te->get_text()); ur->add_undo_method(graph.ptr(),"comment_node_set_text",type,p_id,graph->comment_node_get_text(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -1002,9 +1002,9 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) { DVector<Color> old_colors=graph->color_ramp_node_get_colors(type,p_id); if (old_offsets.size()!=new_offsets.size()) - ur->create_action("Add/Remove to Color Ramp"); + ur->create_action(TTR("Add/Remove to Color Ramp")); else - ur->create_action("Modify Color Ramp",true); + ur->create_action(TTR("Modify Color Ramp"),true); ur->add_do_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,new_colors,new_offsets); ur->add_undo_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,old_colors,old_offsets); @@ -1038,9 +1038,9 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) { DVector<Vector2> old_points=graph->curve_map_node_get_points(type,p_id); if (old_points.size()!=new_points.size()) - ur->create_action("Add/Remove to Curve Map"); + ur->create_action(TTR("Add/Remove to Curve Map")); else - ur->create_action("Modify Curve Map",true); + ur->create_action(TTR("Modify Curve Map"),true); ur->add_do_method(graph.ptr(),"curve_map_node_set_points",type,p_id,new_points); ur->add_undo_method(graph.ptr(),"curve_map_node_set_points",type,p_id,old_points); @@ -1058,7 +1058,7 @@ void ShaderGraphView::_input_name_changed(const String& p_name, int p_id, Node * ERR_FAIL_COND(!le); UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Change Input Name"); + ur->create_action(TTR("Change Input Name")); ur->add_do_method(graph.ptr(),"input_node_set_name",type,p_id,p_name); ur->add_undo_method(graph.ptr(),"input_node_set_name",type,p_id,graph->input_node_get_name(type,p_id)); ur->add_do_method(this,"_update_graph"); @@ -1110,7 +1110,7 @@ void ShaderGraphView::_connection_request(const String& p_from, int p_from_slot, ERR_FAIL_COND(from_idx==-1); ERR_FAIL_COND(to_idx==-1); - ur->create_action("Connect Graph Nodes"); + ur->create_action(TTR("Connect Graph Nodes")); List<ShaderGraph::Connection> conns; @@ -1152,7 +1152,7 @@ void ShaderGraphView::_disconnection_request(const String& p_from, int p_from_sl if (!graph->is_node_connected(type,from_idx,p_from_slot,to_idx,p_to_slot)) return; //nothing to disconnect - ur->create_action("Disconnect Graph Nodes"); + ur->create_action(TTR("Disconnect Graph Nodes")); List<ShaderGraph::Connection> conns; @@ -1170,7 +1170,7 @@ void ShaderGraphView::_disconnection_request(const String& p_from, int p_from_sl void ShaderGraphView::_node_removed(int p_id) { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Remove Shader Graph Node"); + ur->create_action(TTR("Remove Shader Graph Node")); ur->add_do_method(graph.ptr(),"node_remove",type,p_id); ur->add_undo_method(graph.ptr(),"node_add",type,graph->node_get_type(type,p_id),p_id); @@ -1193,7 +1193,7 @@ void ShaderGraphView::_node_removed(int p_id) { void ShaderGraphView::_begin_node_move() { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Move Shader Graph Node"); + ur->create_action(TTR("Move Shader Graph Node")); } void ShaderGraphView::_node_moved(const Vector2& p_from, const Vector2& p_to,int p_id) { @@ -1235,7 +1235,7 @@ void ShaderGraphView::_duplicate_nodes_request() return; UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Duplicate Graph Node(s)"); + ur->create_action(TTR("Duplicate Graph Node(s)")); ur->add_do_method(this,"_duplicate_nodes",s_id); List<int> n_ids = graph->generate_ids(type, s_id.size()); for (List<int>::Element *E=n_ids.front();E;E=E->next()) @@ -1272,7 +1272,7 @@ void ShaderGraphView::_delete_nodes_request() return; UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Delete Shader Graph Node(s)"); + ur->create_action(TTR("Delete Shader Graph Node(s)")); for (List<int>::Element *N=s_id.front();N;N=N->next()) { ur->add_do_method(graph.ptr(),"node_remove",type,N->get()); @@ -1427,7 +1427,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // all inputs (case Shader type dependent) case ShaderGraph::NODE_SCALAR_CONST: { - gn->set_title("Scalar"); + gn->set_title(TTR("Scalar")); SpinBox *sb = memnew( SpinBox ); sb->set_min(-100000); sb->set_max(100000); @@ -1440,7 +1440,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; //scalar constant case ShaderGraph::NODE_VEC_CONST: { - gn->set_title("Vector"); + gn->set_title(TTR("Vector")); Array v3p(true); for(int i=0;i<3;i++) { HBoxContainer *hbc = memnew( HBoxContainer ); @@ -1469,11 +1469,11 @@ void ShaderGraphView::_create_node(int p_id) { cpb->connect("color_changed",this,"_rgb_const_changed",varray(p_id)); gn->add_child(cpb); Label *l = memnew( Label ); - l->set_text("RGB"); + l->set_text(TTR("RGB")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); l = memnew( Label ); - l->set_text("Alpha"); + l->set_text(TTR("Alpha")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); @@ -1482,7 +1482,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; //rgb constant (shows a color picker instead) case ShaderGraph::NODE_XFORM_CONST: { - gn->set_title("XForm"); + gn->set_title(TTR("XForm")); ToolButton *edit = memnew( ToolButton ); edit->set_text("edit.."); edit->connect("pressed",this,"_xform_const_changed",varray(p_id,edit)); @@ -1492,7 +1492,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // 4x4 matrix constant case ShaderGraph::NODE_TIME: { - gn->set_title("Time"); + gn->set_title(TTR("Time")); Label *l = memnew( Label ); l->set_text("(s)"); l->set_align(Label::ALIGN_RIGHT); @@ -1502,34 +1502,34 @@ void ShaderGraphView::_create_node(int p_id) { } break; // time in seconds case ShaderGraph::NODE_SCREEN_TEX: { - gn->set_title("ScreenTex"); + gn->set_title(TTR("ScreenTex")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (!graph->is_slot_connected(type,p_id,0)) { Vector3 v = graph->default_get_value(type, p_id, 0); - hbc->add_child(make_editor("UV: " + v,gn,p_id,0,Variant::VECTOR3)); + hbc->add_child(make_editor(TTR("UV: ") + v,gn,p_id,0,Variant::VECTOR3)); } else { - hbc->add_child(make_label("UV",Variant::VECTOR3)); + hbc->add_child(make_label(TTR("UV"),Variant::VECTOR3)); } hbc->add_spacer(); - hbc->add_child( memnew(Label("RGB"))); + hbc->add_child( memnew(Label(TTR("RGB")))); gn->add_child(hbc); gn->set_slot(0,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); } break; // screen texture sampler (takes UV) (only usable in fragment case Shader) case ShaderGraph::NODE_SCALAR_OP: { - gn->set_title("ScalarOp"); + gn->set_title(TTR("ScalarOp")); static const char* op_name[ShaderGraph::SCALAR_MAX_OP]={ - "Add", - "Sub", - "Mul", - "Div", - "Mod", - "Pow", - "Max", - "Min", - "Atan2" + ("Add"), + ("Sub"), + ("Mul"), + ("Div"), + ("Mod"), + ("Pow"), + ("Max"), + ("Min"), + ("Atan2") }; OptionButton *ob = memnew( OptionButton ); @@ -1567,17 +1567,17 @@ void ShaderGraphView::_create_node(int p_id) { } break; // scalar vs scalar op (mul: { } break; add: { } break; div: { } break; etc) case ShaderGraph::NODE_VEC_OP: { - gn->set_title("VecOp"); + gn->set_title(TTR("VecOp")); static const char* op_name[ShaderGraph::VEC_MAX_OP]={ - "Add", - "Sub", - "Mul", - "Div", - "Mod", - "Pow", - "Max", - "Min", - "Cross" + ("Add"), + ("Sub"), + ("Mul"), + ("Div"), + ("Mod"), + ("Pow"), + ("Max"), + ("Min"), + ("Cross") }; OptionButton *ob = memnew( OptionButton ); @@ -1615,11 +1615,11 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 vs vec3 op (mul: { } break;ad: { } break;div: { } break;crossprod: { } break;etc) case ShaderGraph::NODE_VEC_SCALAR_OP: { - gn->set_title("VecScalarOp"); + gn->set_title(TTR("VecScalarOp")); static const char* op_name[ShaderGraph::VEC_SCALAR_MAX_OP]={ - "Mul", - "Div", - "Pow", + ("Mul"), + ("Div"), + ("Pow"), }; OptionButton *ob = memnew( OptionButton ); @@ -1657,17 +1657,17 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 vs scalar op (mul: { } break; add: { } break; div: { } break; etc) case ShaderGraph::NODE_RGB_OP: { - gn->set_title("RGB Op"); + gn->set_title(TTR("RGB Op")); static const char* op_name[ShaderGraph::RGB_MAX_OP]={ - "Screen", - "Difference", - "Darken", - "Lighten", - "Overlay", - "Dodge", - "Burn", - "SoftLight", - "HardLight" + ("Screen"), + ("Difference"), + ("Darken"), + ("Lighten"), + ("Overlay"), + ("Dodge"), + ("Burn"), + ("SoftLight"), + ("HardLight") }; OptionButton *ob = memnew( OptionButton ); @@ -1702,7 +1702,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 vs vec3 rgb op (with scalar amount): { } break; like brighten: { } break; darken: { } break; burn: { } break; dodge: { } break; multiply: { } break; etc. case ShaderGraph::NODE_XFORM_MULT: { - gn->set_title("XFMult"); + gn->set_title(TTR("XFMult")); HBoxContainer *hbc = memnew( HBoxContainer ); if (graph->is_slot_connected(type, p_id, 0)) { hbc->add_child(make_label("a",Variant::TRANSFORM)); @@ -1725,9 +1725,9 @@ void ShaderGraphView::_create_node(int p_id) { } break; // mat4 x mat4 case ShaderGraph::NODE_XFORM_VEC_MULT: { - gn->set_title("XFVecMult"); + gn->set_title(TTR("XFVecMult")); - CheckBox *button = memnew (CheckBox("RotOnly")); + CheckBox *button = memnew (CheckBox(TTR("RotOnly"))); button->set_pressed(graph->xform_vec_mult_node_get_no_translation(type,p_id)); button->connect("toggled",this,"_xform_inv_rev_changed",varray(p_id)); @@ -1758,10 +1758,10 @@ void ShaderGraphView::_create_node(int p_id) { } break; case ShaderGraph::NODE_XFORM_VEC_INV_MULT: { - gn->set_title("XFVecInvMult"); + gn->set_title(TTR("XFVecInvMult")); - CheckBox *button = memnew( CheckBox("RotOnly")); + CheckBox *button = memnew( CheckBox(TTR("RotOnly"))); button->set_pressed(graph->xform_vec_mult_node_get_no_translation(type,p_id)); button->connect("toggled",this,"_xform_inv_rev_changed",varray(p_id)); @@ -1793,28 +1793,28 @@ void ShaderGraphView::_create_node(int p_id) { } break; // mat4 x vec3 inverse mult (with no-translation option) case ShaderGraph::NODE_SCALAR_FUNC: { - gn->set_title("ScalarFunc"); + gn->set_title(TTR("ScalarFunc")); static const char* func_name[ShaderGraph::SCALAR_MAX_FUNC]={ - "Sin", - "Cos", - "Tan", - "ASin", - "ACos", - "ATan", - "SinH", - "CosH", - "TanH", - "Log", - "Exp", - "Sqrt", - "Abs", - "Sign", - "Floor", - "Round", - "Ceil", - "Frac", - "Satr", - "Neg" + ("Sin"), + ("Cos"), + ("Tan"), + ("ASin"), + ("ACos"), + ("ATan"), + ("SinH"), + ("CosH"), + ("TanH"), + ("Log"), + ("Exp"), + ("Sqrt"), + ("Abs"), + ("Sign"), + ("Floor"), + ("Round"), + ("Ceil"), + ("Frac"), + ("Satr"), + ("Neg") }; OptionButton *ob = memnew( OptionButton ); @@ -1846,14 +1846,14 @@ void ShaderGraphView::_create_node(int p_id) { - gn->set_title("VecFunc"); + gn->set_title(TTR("VecFunc")); static const char* func_name[ShaderGraph::VEC_MAX_FUNC]={ - "Normalize", - "Saturate", - "Negate", - "Reciprocal", - "RGB to HSV", - "HSV to RGB", + ("Normalize"), + ("Saturate"), + ("Negate"), + ("Reciprocal"), + ("RGB to HSV"), + ("HSV to RGB"), }; OptionButton *ob = memnew( OptionButton ); @@ -1882,7 +1882,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vector function (normalize: { } break; negate: { } break; reciprocal: { } break; rgb2hsv: { } break; hsv2rgb: { } break; etc: { } break; etc) case ShaderGraph::NODE_VEC_LEN: { - gn->set_title("VecLength"); + gn->set_title(TTR("VecLength")); HBoxContainer *hbc = memnew( HBoxContainer ); if (graph->is_slot_connected(type, p_id, 0)) { hbc->add_child(make_label("in", Variant::VECTOR3)); @@ -1899,7 +1899,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 length case ShaderGraph::NODE_DOT_PROD: { - gn->set_title("DotProduct"); + gn->set_title(TTR("DotProduct")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { @@ -1924,7 +1924,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 . vec3 (dot product -> scalar output) case ShaderGraph::NODE_VEC_TO_SCALAR: { - gn->set_title("Vec2Scalar"); + gn->set_title(TTR("Vec2Scalar")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { @@ -1955,7 +1955,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // 1 vec3 input: { } break; 3 scalar outputs case ShaderGraph::NODE_SCALAR_TO_VEC: { - gn->set_title("Scalar2Vec"); + gn->set_title(TTR("Scalar2Vec")); HBoxContainer *hbc = memnew( HBoxContainer ); if (graph->is_slot_connected(type, p_id, 0)) { hbc->add_child(make_label("x", Variant::REAL)); @@ -1986,7 +1986,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // 3 scalar input: { } break; 1 vec3 output case ShaderGraph::NODE_VEC_TO_XFORM: { - gn->set_title("Vec2XForm"); + gn->set_title(TTR("Vec2XForm")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { @@ -2025,7 +2025,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // 3 vec input: { } break; 1 xform output case ShaderGraph::NODE_XFORM_TO_VEC: { - gn->set_title("XForm2Vec"); + gn->set_title(TTR("XForm2Vec")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); @@ -2057,7 +2057,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // 3 vec input: { } break; 1 xform output case ShaderGraph::NODE_SCALAR_INTERP: { - gn->set_title("ScalarInterp"); + gn->set_title(TTR("ScalarInterp")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { @@ -2090,7 +2090,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // scalar interpolation (with optional curve) case ShaderGraph::NODE_VEC_INTERP: { - gn->set_title("VecInterp"); + gn->set_title(TTR("VecInterp")); HBoxContainer *hbc = memnew( HBoxContainer ); if (graph->is_slot_connected(type, p_id, 0)) { hbc->add_child(make_label("a", Variant::VECTOR3)); @@ -2174,7 +2174,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // scalar interpolation (with optional curve) case ShaderGraph::NODE_CURVE_MAP: { - gn->set_title("CurveMap"); + gn->set_title(TTR("CurveMap")); GraphCurveMapEdit * map = memnew( GraphCurveMapEdit ); DVector<Vector2> points = graph->curve_map_node_get_points(type,p_id); @@ -2221,7 +2221,7 @@ void ShaderGraphView::_create_node(int p_id) { case ShaderGraph::NODE_SCALAR_INPUT: { - gn->set_title("ScalarUniform"); + gn->set_title(TTR("ScalarUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2238,7 +2238,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // scalar uniform (assignable in material) case ShaderGraph::NODE_VEC_INPUT: { - gn->set_title("VectorUniform"); + gn->set_title(TTR("VectorUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2265,7 +2265,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // vec3 uniform (assignable in material) case ShaderGraph::NODE_RGB_INPUT: { - gn->set_title("ColorUniform"); + gn->set_title(TTR("ColorUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2275,11 +2275,11 @@ void ShaderGraphView::_create_node(int p_id) { cpb->connect("color_changed",this,"_rgb_input_changed",varray(p_id)); gn->add_child(cpb); Label *l = memnew( Label ); - l->set_text("RGB"); + l->set_text(TTR("RGB")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); l = memnew( Label ); - l->set_text("Alpha"); + l->set_text(TTR("Alpha")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); @@ -2289,7 +2289,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // color uniform (assignable in material) case ShaderGraph::NODE_XFORM_INPUT: { - gn->set_title("XFUniform"); + gn->set_title(TTR("XFUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2303,7 +2303,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // mat4 uniform (assignable in material) case ShaderGraph::NODE_TEXTURE_INPUT: { - gn->set_title("TexUniform"); + gn->set_title(TTR("TexUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2321,18 +2321,18 @@ void ShaderGraphView::_create_node(int p_id) { HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { - hbc->add_child(make_label("UV", Variant::VECTOR3)); + hbc->add_child(make_label(TTR("UV"), Variant::VECTOR3)); } else { Vector3 v = graph->default_get_value(type,p_id,0); - hbc->add_child(make_editor(String("UV: ")+v,gn,p_id,0,Variant::VECTOR3)); + hbc->add_child(make_editor(String(TTR("UV: "))+v,gn,p_id,0,Variant::VECTOR3)); } hbc->add_spacer(); - Label *l=memnew(Label("RGB")); + Label *l=memnew(Label(TTR("RGB"))); l->set_align(Label::ALIGN_RIGHT); hbc->add_child(l); gn->add_child(hbc); l = memnew( Label ); - l->set_text("Alpha"); + l->set_text(TTR("Alpha")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); @@ -2342,7 +2342,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // texture input (assignable in material) case ShaderGraph::NODE_CUBEMAP_INPUT: { - gn->set_title("TexUniform"); + gn->set_title(TTR("TexUniform")); LineEdit *le = memnew( LineEdit ); gn->add_child(le); le->set_text(graph->input_node_get_name(type,p_id)); @@ -2357,18 +2357,18 @@ void ShaderGraphView::_create_node(int p_id) { HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { - hbc->add_child(make_label("UV", Variant::VECTOR3)); + hbc->add_child(make_label(TTR("UV"), Variant::VECTOR3)); } else { Vector3 v = graph->default_get_value(type,p_id,0); - hbc->add_child(make_editor(String("UV: ")+v,gn,p_id,0,Variant::VECTOR3)); + hbc->add_child(make_editor(String(TTR("UV: "))+v,gn,p_id,0,Variant::VECTOR3)); } hbc->add_spacer(); - Label *l=memnew(Label("RGB")); + Label *l=memnew(Label(TTR("RGB"))); l->set_align(Label::ALIGN_RIGHT); hbc->add_child(l); gn->add_child(hbc); l = memnew( Label ); - l->set_text("Alpha"); + l->set_text(TTR("Alpha")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); @@ -2378,22 +2378,22 @@ void ShaderGraphView::_create_node(int p_id) { } break; // cubemap input (assignable in material) case ShaderGraph::NODE_DEFAULT_TEXTURE: { - gn->set_title("CanvasItemTex"); + gn->set_title(TTR("CanvasItemTex")); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->add_constant_override("separation",0); if (graph->is_slot_connected(type, p_id, 0)) { - hbc->add_child(make_label("UV", Variant::VECTOR3)); + hbc->add_child(make_label(TTR("UV"), Variant::VECTOR3)); } else { Vector3 v = graph->default_get_value(type,p_id,0); - hbc->add_child(make_editor(String("UV: ")+v,gn,p_id,0,Variant::VECTOR3)); + hbc->add_child(make_editor(String(TTR("UV: "))+v,gn,p_id,0,Variant::VECTOR3)); } hbc->add_spacer(); - Label *l=memnew(Label("RGB")); + Label *l=memnew(Label(TTR("RGB"))); l->set_align(Label::ALIGN_RIGHT); hbc->add_child(l); gn->add_child(hbc); l = memnew( Label ); - l->set_text("Alpha"); + l->set_text(TTR("Alpha")); l->set_align(Label::ALIGN_RIGHT); gn->add_child(l); @@ -2404,7 +2404,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // screen texture sampler (takes UV) (only usable in fragment case Shader) case ShaderGraph::NODE_OUTPUT: { - gn->set_title("Output"); + gn->set_title(TTR("Output")); gn->set_show_close_button(false); List<ShaderGraph::SlotInfo> si; @@ -2412,22 +2412,22 @@ void ShaderGraphView::_create_node(int p_id) { Array colors; colors.push_back("Color"); - colors.push_back("LightColor"); + colors.push_back(TTR("LightColor")); colors.push_back("Light"); - colors.push_back("Diffuse"); - colors.push_back("Specular"); - colors.push_back("Emmision"); + colors.push_back(TTR("Diffuse")); + colors.push_back(TTR("Specular")); + colors.push_back(TTR("Emmision")); Array reals; - reals.push_back("Alpha"); - reals.push_back("DiffuseAlpha"); - reals.push_back("NormalMapDepth"); - reals.push_back("SpecExp"); - reals.push_back("Glow"); - reals.push_back("ShadeParam"); - reals.push_back("SpecularExp"); - reals.push_back("LightAlpha"); - reals.push_back("PointSize"); - reals.push_back("Discard"); + reals.push_back(TTR("Alpha")); + reals.push_back(TTR("DiffuseAlpha")); + reals.push_back(TTR("NormalMapDepth")); + reals.push_back(TTR("SpecExp")); + reals.push_back(TTR("Glow")); + reals.push_back(TTR("ShadeParam")); + reals.push_back(TTR("SpecularExp")); + reals.push_back(TTR("LightAlpha")); + reals.push_back(TTR("PointSize")); + reals.push_back(TTR("Discard")); int idx=0; for (List<ShaderGraph::SlotInfo>::Element *E=si.front();E;E=E->next()) { @@ -2448,7 +2448,7 @@ void ShaderGraphView::_create_node(int p_id) { } break; // output (case Shader type dependent) case ShaderGraph::NODE_COMMENT: { - gn->set_title("Comment"); + gn->set_title(TTR("Comment")); TextEdit *te = memnew(TextEdit); te->set_custom_minimum_size(Size2(100,100)); gn->add_child(te); @@ -2512,8 +2512,8 @@ void ShaderGraphView::_sg_updated() { return; switch(graph->get_graph_error(type)) { case ShaderGraph::GRAPH_OK: status->set_text(""); break; - case ShaderGraph::GRAPH_ERROR_CYCLIC: status->set_text("Error: Cyclic Connection Link"); break; - case ShaderGraph::GRAPH_ERROR_MISSING_CONNECTIONS: status->set_text("Error: Missing Input Connections"); break; + case ShaderGraph::GRAPH_ERROR_CYCLIC: status->set_text(TTR("Error: Cyclic Connection Link")); break; + case ShaderGraph::GRAPH_ERROR_MISSING_CONNECTIONS: status->set_text(TTR("Error: Missing Input Connections")); break; } } @@ -2573,7 +2573,7 @@ void ShaderGraphView::add_node(int p_type, const Vector2 &location) { break; } UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - ur->create_action("Add Shader Graph Node"); + ur->create_action(TTR("Add Shader Graph Node")); ur->add_do_method(graph.ptr(),"node_add",type,p_type,newid); ur->add_do_method(graph.ptr(),"node_set_pos",type,newid,init_ofs); ur->add_undo_method(graph.ptr(),"node_remove",type,newid); @@ -2707,41 +2707,41 @@ void ShaderGraphEditor::_bind_methods() { const char* ShaderGraphEditor::node_names[ShaderGraph::NODE_TYPE_MAX]={ - "GraphInput:Input", // all inputs (shader type dependent) - "GraphScalar:Scalar Constant", //scalar constant - "GraphVector:Vector Constant", //vec3 constant - "GraphRgb:RGB Constant", //rgb constant (shows a color picker instead) - "GraphXform:XForm Constant", // 4x4 matrix constant - "GraphTime:Time:", // time in seconds - "GraphTexscreen:Screen Sample", // screen texture sampler (takes uv) (only usable in fragment shader) - "GraphScalarOp:Scalar Operator", // scalar vs scalar op (mul", add", div", etc) - "GraphVecOp:Vector Operator", // vec3 vs vec3 op (mul",ad",div",crossprod",etc) - "GraphVecScalarOp:Scalar+Vector Operator", // vec3 vs scalar op (mul", add", div", etc) - "GraphRgbOp:RGB Operator:", // vec3 vs vec3 rgb op (with scalar amount)", like brighten", darken", burn", dodge", multiply", etc. - "GraphXformMult:XForm Multiply", // mat4 x mat4 - "GraphXformVecMult:XForm+Vector Multiply", // mat4 x vec3 mult (with no-translation option) - "GraphXformVecImult:Form+Vector InvMultiply:", // mat4 x vec3 inverse mult (with no-translation option) - "GraphXformScalarFunc:Scalar Function", // scalar function (sin", cos", etc) - "GraphXformVecFunc:Vector Function", // vector function (normalize", negate", reciprocal", rgb2hsv", hsv2rgb", etc", etc) - "GraphVecLength:Vector Length", // vec3 length - "GraphVecDp:Dot Product:", // vec3 . vec3 (dot product -> scalar output) - "GraphVecToScalars:Vector -> Scalars", // 1 vec3 input", 3 scalar outputs - "GraphScalarsToVec:Scalars -> Vector", // 3 scalar input", 1 vec3 output - "GraphXformToVecs:XForm -> Vectors", // 3 vec input", 1 xform output - "GraphVecsToXform:Vectors -> XForm:", // 3 vec input", 1 xform output - "GraphScalarInterp:Scalar Interpolate", // scalar interpolation (with optional curve) - "GraphVecInterp:Vector Interpolate:", // vec3 interpolation (with optional curve) - "GraphColorRamp:Color Ramp", // vec3 interpolation (with optional curve) - "GraphCurveMap:Curve Remap:", // vec3 interpolation (with optional curve) - "GraphScalarUniform:Scalar Uniform", // scalar uniform (assignable in material) - "GraphVectorUniform:Vector Uniform", // vec3 uniform (assignable in material) - "GraphRgbUniform:RGB Uniform", // color uniform (assignable in material) - "GraphXformUniform:XForm Uniform", // mat4 uniform (assignable in material) - "GraphTextureUniform:Texture Uniform", // texture input (assignable in material) - "GraphCubeUniform:CubeMap Uniform:", // cubemap input (assignable in material) - "GraphDefaultTexture:CanvasItem Texture:", // cubemap input (assignable in material) - "Output", // output (shader type dependent) - "GraphComment:Comment", // comment + ("GraphInput:Input"), // all inputs (shader type dependent) + ("GraphScalar:Scalar Constant"), //scalar constant + ("GraphVector:Vector Constant"), //vec3 constant + ("GraphRgb:RGB Constant"), //rgb constant (shows a color picker instead) + ("GraphXform:XForm Constant"), // 4x4 matrix constant + ("GraphTime:Time:"), // time in seconds + ("GraphTexscreen:Screen Sample"), // screen texture sampler (takes uv) (only usable in fragment shader) + ("GraphScalarOp:Scalar Operator"), // scalar vs scalar op (mul", add", div", etc) + ("GraphVecOp:Vector Operator"), // vec3 vs vec3 op (mul",ad",div",crossprod",etc) + ("GraphVecScalarOp:Scalar+Vector Operator"), // vec3 vs scalar op (mul", add", div", etc) + ("GraphRgbOp:RGB Operator:"), // vec3 vs vec3 rgb op (with scalar amount)", like brighten", darken", burn", dodge", multiply", etc. + ("GraphXformMult:XForm Multiply"), // mat4 x mat4 + ("GraphXformVecMult:XForm+Vector Multiply"), // mat4 x vec3 mult (with no-translation option) + ("GraphXformVecImult:Form+Vector InvMultiply:"), // mat4 x vec3 inverse mult (with no-translation option) + ("GraphXformScalarFunc:Scalar Function"), // scalar function (sin", cos", etc) + ("GraphXformVecFunc:Vector Function"), // vector function (normalize", negate", reciprocal", rgb2hsv", hsv2rgb", etc", etc) + ("GraphVecLength:Vector Length"), // vec3 length + ("GraphVecDp:Dot Product:"), // vec3 . vec3 (dot product -> scalar output) + ("GraphVecToScalars:Vector -> Scalars"), // 1 vec3 input", 3 scalar outputs + ("GraphScalarsToVec:Scalars -> Vector"), // 3 scalar input", 1 vec3 output + ("GraphXformToVecs:XForm -> Vectors"), // 3 vec input", 1 xform output + ("GraphVecsToXform:Vectors -> XForm:"), // 3 vec input", 1 xform output + ("GraphScalarInterp:Scalar Interpolate"), // scalar interpolation (with optional curve) + ("GraphVecInterp:Vector Interpolate:"), // vec3 interpolation (with optional curve) + ("GraphColorRamp:Color Ramp"), // vec3 interpolation (with optional curve) + ("GraphCurveMap:Curve Remap:"), // vec3 interpolation (with optional curve) + ("GraphScalarUniform:Scalar Uniform"), // scalar uniform (assignable in material) + ("GraphVectorUniform:Vector Uniform"), // vec3 uniform (assignable in material) + ("GraphRgbUniform:RGB Uniform"), // color uniform (assignable in material) + ("GraphXformUniform:XForm Uniform"), // mat4 uniform (assignable in material) + ("GraphTextureUniform:Texture Uniform"), // texture input (assignable in material) + ("GraphCubeUniform:CubeMap Uniform:"), // cubemap input (assignable in material) + ("GraphDefaultTexture:CanvasItem Texture:"), // cubemap input (assignable in material) + ("Output"), // output (shader type dependent) + ("GraphComment:Comment"), // comment }; diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index c4d3f7282e..331cf6309c 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -561,7 +561,7 @@ void SpatialEditorViewport::_select_region() { void SpatialEditorViewport::_update_name() { - String ortho = orthogonal?"Orthogonal":"Perspective"; + String ortho = orthogonal?TTR("Orthogonal"):"Perspective"; if (name!="") view_menu->set_text("[ "+name+" "+ortho+" ]"); @@ -984,7 +984,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } surface->update(); //VisualServer::get_singleton()->poly_clear(indicators); - set_message("Transform Aborted.",3); + set_message(TTR("Transform Aborted."),3); } } break; case BUTTON_MIDDLE: { @@ -996,26 +996,26 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { case TRANSFORM_VIEW: { _edit.plane=TRANSFORM_X_AXIS; - set_message("View Plane Transform.",2); + set_message(TTR("View Plane Transform."),2); name=""; _update_name(); } break; case TRANSFORM_X_AXIS: { _edit.plane=TRANSFORM_Y_AXIS; - set_message("X-Axis Transform.",2); + set_message(TTR("X-Axis Transform."),2); } break; case TRANSFORM_Y_AXIS: { _edit.plane=TRANSFORM_Z_AXIS; - set_message("Y-Axis Transform.",2); + set_message(TTR("Y-Axis Transform."),2); } break; case TRANSFORM_Z_AXIS: { _edit.plane=TRANSFORM_VIEW; - set_message("Z-Axis Transform.",2); + set_message(TTR("Z-Axis Transform."),2); } break; } @@ -1156,7 +1156,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { _edit.gizmo_handle=gizmo_handle; //_edit.gizmo_initial_pos=seg->get_handle_pos(gizmo_handle); _edit.gizmo_initial_value=seg->get_handle_value(gizmo_handle); - //print_line("GIZMO: "+itos(gizmo_handle)+" FROMPOS: "+_edit.orig_gizmo_pos); + //print_line(TTR("GIZMO: ")+itos(gizmo_handle)+" FROMPOS: "+_edit.orig_gizmo_pos); break; } @@ -1353,7 +1353,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { scale = Math::stepify(scale,spatial_editor->get_scale_snap()); } - set_message("Scaling to "+String::num(scale,1)+"%."); + set_message(TTR("Scaling to ")+String::num(scale,1)+"%."); scale/=100.0; Transform r; @@ -1431,7 +1431,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { motion.snap(snap); } - //set_message("Translating: "+motion); + //set_message(TTR("Translating: ")+motion); List<Node*> &selection = editor_selection->get_selected_node_list(); @@ -1493,13 +1493,13 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (snap) { angle=Math::rad2deg(angle)+snap*0.5; //else it wont reach +180 angle-=Math::fmod(angle,snap); - set_message("Rotating "+rtos(angle)+" degrees."); + set_message(TTR("Rotating ")+rtos(angle)+" degrees."); angle=Math::deg2rad(angle); } else - set_message("Rotating "+rtos(Math::rad2deg(angle))+" degrees."); + set_message(TTR("Rotating ")+rtos(Math::rad2deg(angle))+" degrees."); } else { - set_message("Rotating "+rtos(Math::rad2deg(angle))+" degrees."); + set_message(TTR("Rotating ")+rtos(Math::rad2deg(angle))+" degrees."); } @@ -1681,14 +1681,14 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { cursor.y_rot=0; if (k.mod.shift) { cursor.x_rot=-Math_PI/2.0; - set_message("Bottom View.",2); - name="Bottom"; + set_message(TTR("Bottom View."),2); + name=TTR("Bottom"); _update_name(); } else { cursor.x_rot=Math_PI/2.0; - set_message("Top View.",2); - name="Top"; + set_message(TTR("Top View."),2); + name=TTR("Top"); _update_name(); } } break; @@ -1700,14 +1700,14 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { cursor.x_rot=0; if (k.mod.shift) { cursor.y_rot=Math_PI; - set_message("Rear View.",2); - name="Rear"; + set_message(TTR("Rear View."),2); + name=TTR("Rear"); _update_name(); } else { cursor.y_rot=0; - set_message("Front View.",2); - name="Front"; + set_message(TTR("Front View."),2); + name=TTR("Front"); _update_name(); } @@ -1720,13 +1720,13 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { cursor.x_rot=0; if (k.mod.shift) { cursor.y_rot=Math_PI/2.0; - set_message("Left View.",2); - name="Left"; + set_message(TTR("Left View."),2); + name=TTR("Left"); _update_name(); } else { cursor.y_rot=-Math_PI/2.0; - set_message("Right View.",2); - name="Right"; + set_message(TTR("Right View."),2); + name=TTR("Right"); _update_name(); } @@ -1749,7 +1749,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { break; if (!AnimationPlayerEditor::singleton->get_key_editor()->has_keying()) { - set_message("Keying is disabled (no key inserted)."); + set_message(TTR("Keying is disabled (no key inserted).")); break; } @@ -1765,7 +1765,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } - set_message("Animation Key Inserted."); + set_message(TTR("Animation Key Inserted.")); @@ -1967,7 +1967,7 @@ void SpatialEditorViewport::_draw() { if (surface->has_focus()) { Size2 size = surface->get_size(); Rect2 r =Rect2(Point2(),size); - get_stylebox("EditorFocus","EditorStyles")->draw(surface->get_canvas_item(),r); + get_stylebox(TTR("EditorFocus"),"EditorStyles")->draw(surface->get_canvas_item(),r); } @@ -2041,14 +2041,14 @@ void SpatialEditorViewport::_menu_option(int p_option) { cursor.x_rot=Math_PI/2.0; cursor.y_rot=0; - name="Top"; + name=TTR("Top"); _update_name(); } break; case VIEW_BOTTOM: { cursor.x_rot=-Math_PI/2.0; cursor.y_rot=0; - name="Bottom"; + name=TTR("Bottom"); _update_name(); } break; @@ -2056,7 +2056,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { cursor.y_rot=Math_PI/2.0; cursor.x_rot=0; - name="Left"; + name=TTR("Left"); _update_name(); } break; @@ -2064,7 +2064,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { cursor.y_rot=-Math_PI/2.0; cursor.x_rot=0; - name="Right"; + name=TTR("Right"); _update_name(); } break; @@ -2072,7 +2072,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { cursor.y_rot=0; cursor.x_rot=0; - name="Front"; + name=TTR("Front"); _update_name(); } break; @@ -2080,7 +2080,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { cursor.y_rot=Math_PI; cursor.x_rot=0; - name="Rear"; + name=TTR("Rear"); _update_name(); } break; @@ -2123,7 +2123,7 @@ void SpatialEditorViewport::_menu_option(int p_option) { List<Node*> &selection = editor_selection->get_selected_node_list(); - undo_redo->create_action("Align with view"); + undo_redo->create_action(TTR("Align with view")); for(List<Node*>::Element *E=selection.front();E;E=E->next()) { Spatial *sp = E->get()->cast_to<Spatial>(); @@ -2420,7 +2420,7 @@ void SpatialEditorViewport::reset() { message_time=0; message=""; last_message=""; - name="Top"; + name=TTR("Top"); cursor.x_rot=0; cursor.y_rot=0; @@ -2471,28 +2471,28 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->set_pos( Point2(4,4)); view_menu->set_self_opacity(0.5); - view_menu->get_popup()->add_item("Top (Num7)",VIEW_TOP); - view_menu->get_popup()->add_item("Bottom (Shift+Num7)",VIEW_BOTTOM); - view_menu->get_popup()->add_item("Left (Num3)",VIEW_LEFT); - view_menu->get_popup()->add_item("Right (Shift+Num3)",VIEW_RIGHT); - view_menu->get_popup()->add_item("Front (Num1)",VIEW_FRONT); - view_menu->get_popup()->add_item("Rear (Shift+Num1)",VIEW_REAR); + view_menu->get_popup()->add_item(TTR("Top (Num7)"),VIEW_TOP); + view_menu->get_popup()->add_item(TTR("Bottom (Shift+Num7)"),VIEW_BOTTOM); + view_menu->get_popup()->add_item(TTR("Left (Num3)"),VIEW_LEFT); + view_menu->get_popup()->add_item(TTR("Right (Shift+Num3)"),VIEW_RIGHT); + view_menu->get_popup()->add_item(TTR("Front (Num1)"),VIEW_FRONT); + view_menu->get_popup()->add_item(TTR("Rear (Shift+Num1)"),VIEW_REAR); view_menu->get_popup()->add_separator(); - view_menu->get_popup()->add_check_item("Perspective (Num5)",VIEW_PERSPECTIVE); - view_menu->get_popup()->add_check_item("Orthogonal (Num5)",VIEW_ORTHOGONAL); + view_menu->get_popup()->add_check_item(TTR("Perspective (Num5)"),VIEW_PERSPECTIVE); + view_menu->get_popup()->add_check_item(TTR("Orthogonal (Num5)"),VIEW_ORTHOGONAL); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_PERSPECTIVE),true); view_menu->get_popup()->add_separator(); view_menu->get_popup()->add_check_item("Environment",VIEW_ENVIRONMENT); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(VIEW_ENVIRONMENT),true); view_menu->get_popup()->add_separator(); - view_menu->get_popup()->add_check_item("Audio Listener",VIEW_AUDIO_LISTENER); + view_menu->get_popup()->add_check_item(TTR("Audio Listener"),VIEW_AUDIO_LISTENER); view_menu->get_popup()->add_separator(); - view_menu->get_popup()->add_check_item("Gizmos",VIEW_GIZMOS); + view_menu->get_popup()->add_check_item(TTR("Gizmos"),VIEW_GIZMOS); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(VIEW_GIZMOS),true); view_menu->get_popup()->add_separator(); - view_menu->get_popup()->add_item("Selection (F)",VIEW_CENTER_TO_SELECTION); - view_menu->get_popup()->add_item("Align with view (Ctrl+Shift+F)",VIEW_ALIGN_SELECTION_WITH_VIEW); + view_menu->get_popup()->add_item(TTR("Selection (F)"),VIEW_CENTER_TO_SELECTION); + view_menu->get_popup()->add_item(TTR("Align with view (Ctrl+Shift+F)"),VIEW_ALIGN_SELECTION_WITH_VIEW); view_menu->get_popup()->connect("item_pressed",this,"_menu_option"); preview_camera = memnew( Button ); @@ -2519,7 +2519,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed } - name="Top"; + name=TTR("Top"); _update_name(); EditorSettings::get_singleton()->connect("settings_changed",this,"update_transform_gizmo_view"); @@ -2896,7 +2896,7 @@ void SpatialEditor::_xform_dialog_action() { } - undo_redo->create_action("XForm Dialog"); + undo_redo->create_action(TTR("XForm Dialog")); List<Node*> &selection = editor_selection->get_selected_node_list(); @@ -2941,7 +2941,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { tool_button[i]->set_pressed(i==p_option); tool_mode=(ToolMode)p_option; - static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."}; + // static const char *_mode[]={"Selection Mode.","Translation Mode.","Rotation Mode.","Scale Mode.","List Selection Mode."}; // set_message(_mode[p_option],3); update_transform_gizmo(); @@ -3545,16 +3545,16 @@ void SpatialEditor::_instance_scene() { ERR_FAIL_COND(!en); String path = en->get_scenes_dock()->get_selected_path(); if (path=="") { - set_message("No scene selected to instance!"); + set_message(TTR("No scene selected to instance!")); return; } - undo_redo->create_action("Instance at Cursor"); + undo_redo->create_action(TTR("Instance at Cursor")); Node* scene = en->request_instance_scene(path); if (!scene) { - set_message("Could not instance scene!"); + set_message(TTR("Could not instance scene!")); undo_redo->commit_action(); //bleh return; } @@ -3912,7 +3912,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_MOVE]->set_flat(true); button_binds[0]=MENU_TOOL_MOVE; tool_button[TOOL_MODE_MOVE]->connect("pressed", this,"_menu_item_pressed",button_binds); - tool_button[TOOL_MODE_MOVE]->set_tooltip("Move Mode (W)"); + tool_button[TOOL_MODE_MOVE]->set_tooltip(TTR("Move Mode (W)")); tool_button[TOOL_MODE_ROTATE] = memnew( ToolButton ); hbc_menu->add_child( tool_button[TOOL_MODE_ROTATE] ); @@ -3920,7 +3920,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_ROTATE]->set_flat(true); button_binds[0]=MENU_TOOL_ROTATE; tool_button[TOOL_MODE_ROTATE]->connect("pressed", this,"_menu_item_pressed",button_binds); - tool_button[TOOL_MODE_ROTATE]->set_tooltip("Rotate Mode (E)"); + tool_button[TOOL_MODE_ROTATE]->set_tooltip(TTR("Rotate Mode (E)")); tool_button[TOOL_MODE_SCALE] = memnew( ToolButton ); hbc_menu->add_child( tool_button[TOOL_MODE_SCALE] ); @@ -3928,7 +3928,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { tool_button[TOOL_MODE_SCALE]->set_flat(true); button_binds[0]=MENU_TOOL_SCALE; tool_button[TOOL_MODE_SCALE]->connect("pressed", this,"_menu_item_pressed",button_binds); - tool_button[TOOL_MODE_SCALE]->set_tooltip("Scale Mode (R)"); + tool_button[TOOL_MODE_SCALE]->set_tooltip(TTR("Scale Mode (R)")); instance_button = memnew( Button ); hbc_menu->add_child( instance_button ); @@ -3958,25 +3958,25 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { hbc_menu->add_child( transform_menu ); p = transform_menu->get_popup(); - p->add_check_item("Use Snap",MENU_TRANSFORM_USE_SNAP); - p->add_item("Configure Snap..",MENU_TRANSFORM_CONFIGURE_SNAP); + p->add_check_item(TTR("Use Snap"),MENU_TRANSFORM_USE_SNAP); + p->add_item(TTR("Configure Snap.."),MENU_TRANSFORM_CONFIGURE_SNAP); p->add_separator(); - p->add_check_item("Local Coords",MENU_TRANSFORM_LOCAL_COORDS); + p->add_check_item(TTR("Local Coords"),MENU_TRANSFORM_LOCAL_COORDS); //p->set_item_checked(p->get_item_count()-1,true); p->add_separator(); - p->add_item("Transform Dialog..",MENU_TRANSFORM_DIALOG); + p->add_item(TTR("Transform Dialog.."),MENU_TRANSFORM_DIALOG); p->connect("item_pressed", this,"_menu_item_pressed"); view_menu = memnew( MenuButton ); - view_menu->set_text("View"); + view_menu->set_text(TTR("View")); view_menu->set_pos( Point2( 212,0) ); hbc_menu->add_child( view_menu ); p = view_menu->get_popup(); - p->add_check_item("Use Default Light",MENU_VIEW_USE_DEFAULT_LIGHT); - p->add_check_item("Use Default sRGB",MENU_VIEW_USE_DEFAULT_SRGB); + p->add_check_item(TTR("Use Default Light"),MENU_VIEW_USE_DEFAULT_LIGHT); + p->add_check_item(TTR("Use Default sRGB"),MENU_VIEW_USE_DEFAULT_SRGB); p->add_separator(); p->add_check_item("1 Viewport",MENU_VIEW_USE_1_VIEWPORT,KEY_MASK_CMD+KEY_1); @@ -3987,15 +3987,15 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_check_item("4 Viewports",MENU_VIEW_USE_4_VIEWPORTS,KEY_MASK_CMD+KEY_4); p->add_separator(); - p->add_check_item("Display Normal",MENU_VIEW_DISPLAY_NORMAL); - p->add_check_item("Display Wireframe",MENU_VIEW_DISPLAY_WIREFRAME); - p->add_check_item("Display Overdraw",MENU_VIEW_DISPLAY_OVERDRAW); - p->add_check_item("Display Shadeless",MENU_VIEW_DISPLAY_SHADELESS); + p->add_check_item(TTR("Display Normal"),MENU_VIEW_DISPLAY_NORMAL); + p->add_check_item(TTR("Display Wireframe"),MENU_VIEW_DISPLAY_WIREFRAME); + p->add_check_item(TTR("Display Overdraw"),MENU_VIEW_DISPLAY_OVERDRAW); + p->add_check_item(TTR("Display Shadeless"),MENU_VIEW_DISPLAY_SHADELESS); p->add_separator(); - p->add_check_item("View Origin",MENU_VIEW_ORIGIN); - p->add_check_item("View Grid",MENU_VIEW_GRID); + p->add_check_item(TTR("View Origin"),MENU_VIEW_ORIGIN); + p->add_check_item(TTR("View Grid"),MENU_VIEW_GRID); p->add_separator(); - p->add_item("Settings",MENU_VIEW_CAMERA_SETTINGS); + p->add_item(TTR("Settings"),MENU_VIEW_CAMERA_SETTINGS); p->set_item_checked( p->get_item_index(MENU_VIEW_USE_DEFAULT_LIGHT), true ); @@ -4033,7 +4033,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { /* SNAP DIALOG */ snap_dialog = memnew( ConfirmationDialog ); - snap_dialog->set_title("Snap Settings"); + snap_dialog->set_title(TTR("Snap Settings")); add_child(snap_dialog); VBoxContainer *snap_dialog_vbc = memnew( VBoxContainer ); @@ -4042,20 +4042,20 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { snap_translate = memnew( LineEdit ); snap_translate->set_text("1"); - snap_dialog_vbc->add_margin_child("Translate Snap:",snap_translate); + snap_dialog_vbc->add_margin_child(TTR("Translate Snap:"),snap_translate); snap_rotate = memnew( LineEdit ); snap_rotate->set_text("5"); - snap_dialog_vbc->add_margin_child("Rotate Snap (deg.):",snap_rotate); + snap_dialog_vbc->add_margin_child(TTR("Rotate Snap (deg.):"),snap_rotate); snap_scale = memnew( LineEdit ); snap_scale->set_text("5"); - snap_dialog_vbc->add_margin_child("Scale Snap (%):",snap_scale); + snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"),snap_scale); /* SETTINGS DIALOG */ settings_dialog = memnew( ConfirmationDialog ); - settings_dialog->set_title("Viewport Settings"); + settings_dialog->set_title(TTR("Viewport Settings")); add_child(settings_dialog); settings_vbc = memnew( VBoxContainer ); settings_vbc->set_custom_minimum_size(Size2(200,0)); @@ -4067,7 +4067,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_light_base = memnew( Control ); settings_light_base->set_custom_minimum_size(Size2(128,128)); settings_light_base->connect("input_event",this,"_default_light_angle_input"); - settings_vbc->add_margin_child("Default Light Normal:",settings_light_base); + settings_vbc->add_margin_child(TTR("Default Light Normal:"),settings_light_base); settings_light_vp = memnew( Viewport ); settings_light_vp->set_disable_input(true); settings_light_vp->set_use_own_world(true); @@ -4092,7 +4092,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_ambient_color = memnew( ColorPickerButton ); - settings_vbc->add_margin_child("Ambient Light Color:",settings_ambient_color); + settings_vbc->add_margin_child(TTR("Ambient Light Color:"),settings_ambient_color); settings_ambient_color->connect("color_changed",this,"_update_ambient_light_color"); viewport_environment->set_enable_fx(Environment::FX_AMBIENT_LIGHT,true); @@ -4105,30 +4105,30 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_min(1); settings_fov->set_step(0.01); settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); - settings_vbc->add_margin_child("Perspective FOV (deg.):",settings_fov); + settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"),settings_fov); settings_znear = memnew( SpinBox ); settings_znear->set_max(10000); settings_znear->set_min(0.1); settings_znear->set_step(0.01); settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); - settings_vbc->add_margin_child("View Z-Near:",settings_znear); + settings_vbc->add_margin_child(TTR("View Z-Near:"),settings_znear); settings_zfar = memnew( SpinBox ); settings_zfar->set_max(10000); settings_zfar->set_min(0.1); settings_zfar->set_step(0.01); settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500)); - settings_vbc->add_margin_child("View Z-Far:",settings_zfar); + settings_vbc->add_margin_child(TTR("View Z-Far:"),settings_zfar); //settings_dialog->get_cancel()->hide(); /* XFORM DIALOG */ xform_dialog = memnew( ConfirmationDialog ); - xform_dialog->set_title("Transform Change"); + xform_dialog->set_title(TTR("Transform Change")); add_child(xform_dialog); Label *l = memnew(Label); - l->set_text("Translate:"); + l->set_text(TTR("Translate:")); l->set_pos(Point2(5,5)); xform_dialog->add_child(l); @@ -4141,7 +4141,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { } l = memnew(Label); - l->set_text("Rotate (deg.):"); + l->set_text(TTR("Rotate (deg.):")); l->set_pos(Point2(5,45)); xform_dialog->add_child(l); @@ -4153,7 +4153,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { } l = memnew(Label); - l->set_text("Scale (ratio):"); + l->set_text(TTR("Scale (ratio):")); l->set_pos(Point2(5,85)); xform_dialog->add_child(l); @@ -4165,7 +4165,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { } l = memnew(Label); - l->set_text("Transform Type"); + l->set_text(TTR("Transform Type")); l->set_pos(Point2(5,125)); xform_dialog->add_child(l); @@ -4173,8 +4173,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { xform_type->set_anchor( MARGIN_RIGHT, ANCHOR_END ); xform_type->set_begin( Point2(15,142) ); xform_type->set_end( Point2(15,75) ); - xform_type->add_item("Pre"); - xform_type->add_item("Post"); + xform_type->add_item(TTR("Pre")); + xform_type->add_item(TTR("Post")); xform_dialog->add_child(xform_type); xform_dialog->connect("confirmed", this,"_xform_dialog_action"); diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index af73828b61..796fc23d9a 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -72,10 +72,10 @@ void SpriteFramesEditor::_file_load_request(const DVector<String>& p_path) { resource = ResourceLoader::load(p_path[i]); if (resource.is_null()) { - dialog->set_text("ERROR: Couldn't load frame resource!"); - dialog->set_title("Error!"); - //dialog->get_cancel()->set_text("Close"); - dialog->get_ok()->set_text("Close"); + dialog->set_text(TTR("ERROR: Couldn't load frame resource!")); + dialog->set_title(TTR("Error!")); + //dialog->get_cancel()->set_text(TTR("Close")); + dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess } @@ -89,7 +89,7 @@ void SpriteFramesEditor::_file_load_request(const DVector<String>& p_path) { return; } - undo_redo->create_action("Add Frame"); + undo_redo->create_action(TTR("Add Frame")); int fc=frames->get_frame_count(); for(List< Ref<Texture> >::Element *E=resources.front();E;E=E->next() ) { @@ -144,7 +144,7 @@ void SpriteFramesEditor::_item_edited() { } RES samp = frames->get_resource(old_name); - undo_redo->create_action("Rename Resource"); + undo_redo->create_action(TTR("Rename Resource")); undo_redo->add_do_method(frames,"remove_resource",old_name); undo_redo->add_do_method(frames,"add_resource",new_name,samp); undo_redo->add_undo_method(frames,"remove_resource",new_name); @@ -170,7 +170,7 @@ void SpriteFramesEditor::_delete_confirm_pressed() { int to_remove = tree->get_selected()->get_metadata(0); sel=to_remove; Ref<Texture> r = frames->get_frame(to_remove); - undo_redo->create_action("Delete Resource"); + undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(frames,"remove_frame",to_remove); undo_redo->add_undo_method(frames,"add_frame",r,to_remove); undo_redo->add_do_method(this,"_update_library"); @@ -184,16 +184,16 @@ void SpriteFramesEditor::_paste_pressed() { Ref<Texture> r=EditorSettings::get_singleton()->get_resource_clipboard(); if (!r.is_valid()) { - dialog->set_text("Resource clipboard is empty or not a texture!"); - dialog->set_title("Error!"); - //dialog->get_cancel()->set_text("Close"); - dialog->get_ok()->set_text("Close"); + dialog->set_text(TTR("Resource clipboard is empty or not a texture!")); + dialog->set_title(TTR("Error!")); + //dialog->get_cancel()->set_text(TTR("Close")); + dialog->get_ok()->set_text(TTR("Close")); dialog->popup_centered_minsize(); return; ///beh should show an error i guess } - undo_redo->create_action("Paste Frame"); + undo_redo->create_action(TTR("Paste Frame")); undo_redo->add_do_method(frames,"add_frame",r); undo_redo->add_undo_method(frames,"remove_frame",frames->get_frame_count()); undo_redo->add_do_method(this,"_update_library"); @@ -220,7 +220,7 @@ void SpriteFramesEditor::_empty_pressed() { Ref<Texture> r; - undo_redo->create_action("Add Empty"); + undo_redo->create_action(TTR("Add Empty")); undo_redo->add_do_method(frames,"add_frame",r,from); undo_redo->add_undo_method(frames,"remove_frame",from); undo_redo->add_do_method(this,"_update_library"); @@ -247,7 +247,7 @@ void SpriteFramesEditor::_empty2_pressed() { Ref<Texture> r; - undo_redo->create_action("Add Empty"); + undo_redo->create_action(TTR("Add Empty")); undo_redo->add_do_method(frames,"add_frame",r,from+1); undo_redo->add_undo_method(frames,"remove_frame",from+1); undo_redo->add_do_method(this,"_update_library"); @@ -268,7 +268,7 @@ void SpriteFramesEditor::_up_pressed() { sel-=1; Ref<Texture> r = frames->get_frame(to_move); - undo_redo->create_action("Delete Resource"); + undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(frames,"set_frame",to_move,frames->get_frame(to_move-1)); undo_redo->add_do_method(frames,"set_frame",to_move-1,frames->get_frame(to_move)); undo_redo->add_undo_method(frames,"set_frame",to_move,frames->get_frame(to_move)); @@ -291,7 +291,7 @@ void SpriteFramesEditor::_down_pressed() { sel+=1; Ref<Texture> r = frames->get_frame(to_move); - undo_redo->create_action("Delete Resource"); + undo_redo->create_action(TTR("Delete Resource")); undo_redo->add_do_method(frames,"set_frame",to_move,frames->get_frame(to_move+1)); undo_redo->add_do_method(frames,"set_frame",to_move+1,frames->get_frame(to_move)); undo_redo->add_undo_method(frames,"set_frame",to_move,frames->get_frame(to_move)); @@ -313,11 +313,11 @@ void SpriteFramesEditor::_delete_pressed() { _delete_confirm_pressed(); //it has undo.. why bother with a dialog.. /* - dialog->set_title("Confirm..."); - dialog->set_text("Remove Resource '"+tree->get_selected()->get_text(0)+"' ?"); - //dialog->get_cancel()->set_text("Cancel"); + dialog->set_title(TTR("Confirm...")); + dialog->set_text(TTR("Remove Resource '")+tree->get_selected()->get_text(0)+"' ?"); + //dialog->get_cancel()->set_text(TTR("Cancel")); //dialog->get_ok()->show(); - dialog->get_ok()->set_text("Remove"); + dialog->get_ok()->set_text(TTR("Remove")); dialog->popup_centered(Size2(300,60));*/ } @@ -342,10 +342,10 @@ void SpriteFramesEditor::_update_library() { if (frames->get_frame(i).is_null()) { - ti->set_text(0,"Frame "+itos(i)+" (empty)"); + ti->set_text(0,TTR("Frame ")+itos(i)+" (empty)"); } else { - ti->set_text(0,"Frame "+itos(i)+" ("+frames->get_frame(i)->get_name()+")"); + ti->set_text(0,TTR("Frame ")+itos(i)+" ("+frames->get_frame(i)->get_name()+")"); ti->set_icon(0,frames->get_frame(i)); } if (frames->get_frame(i).is_valid()) @@ -405,30 +405,30 @@ SpriteFramesEditor::SpriteFramesEditor() { vbc->add_child(hbc); load = memnew( Button ); - load->set_tooltip("Load Resource"); + load->set_tooltip(TTR("Load Resource")); hbc->add_child(load); paste = memnew( Button ); - paste->set_text("Paste"); + paste->set_text(TTR("Paste")); hbc->add_child(paste); empty = memnew( Button ); - empty->set_text("Insert Empty (Before)"); + empty->set_text(TTR("Insert Empty (Before)")); hbc->add_child(empty); empty2 = memnew( Button ); - empty2->set_text("Insert Empty (After)"); + empty2->set_text(TTR("Insert Empty (After)")); hbc->add_child(empty2); move_up = memnew( Button ); - move_up->set_text("Up"); + move_up->set_text(TTR("Up")); hbc->add_child(move_up); move_down = memnew( Button ); - move_down->set_text("Down"); + move_down->set_text(TTR("Down")); hbc->add_child(move_down); _delete = memnew( Button ); diff --git a/tools/editor/plugins/sprite_region_editor_plugin.cpp b/tools/editor/plugins/sprite_region_editor_plugin.cpp index 8dfa8a60a6..5e7816ffb5 100644 --- a/tools/editor/plugins/sprite_region_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_region_editor_plugin.cpp @@ -173,7 +173,7 @@ void SpriteRegionEditor::_region_input(const InputEvent& p_input) } else if (drag) { - undo_redo->create_action("Set region_rect"); + undo_redo->create_action(TTR("Set region_rect")); undo_redo->add_do_method(node,"set_region_rect",node->get_region_rect()); undo_redo->add_undo_method(node,"set_region_rect",rect_prev); undo_redo->add_do_method(edit_draw,"update"); @@ -420,7 +420,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) dlg_editor = memnew( AcceptDialog ); add_child(dlg_editor); - dlg_editor->set_title("Sprite Region Editor"); + dlg_editor->set_title(TTR("Sprite Region Editor")); dlg_editor->set_self_opacity(0.9); VBoxContainer *main_vb = memnew( VBoxContainer ); @@ -431,24 +431,24 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) b_snap_enable = memnew( ToolButton ); hb_tools->add_child(b_snap_enable); - b_snap_enable->set_text("Snap"); + b_snap_enable->set_text(TTR("Snap")); b_snap_enable->set_focus_mode(FOCUS_NONE); b_snap_enable->set_toggle_mode(true); b_snap_enable->set_pressed(use_snap); - b_snap_enable->set_tooltip("Enable Snap"); + b_snap_enable->set_tooltip(TTR("Enable Snap")); b_snap_enable->connect("toggled",this,"_set_use_snap"); b_snap_grid = memnew( ToolButton ); hb_tools->add_child(b_snap_grid); - b_snap_grid->set_text("Grid"); + b_snap_grid->set_text(TTR("Grid")); b_snap_grid->set_focus_mode(FOCUS_NONE); b_snap_grid->set_toggle_mode(true); b_snap_grid->set_pressed(snap_show_grid); - b_snap_grid->set_tooltip("Show Grid"); + b_snap_grid->set_tooltip(TTR("Show Grid")); b_snap_grid->connect("toggled",this,"_set_show_grid"); hb_tools->add_child( memnew( VSeparator )); - hb_tools->add_child( memnew( Label("Grid Offset:") ) ); + hb_tools->add_child( memnew( Label(TTR("Grid Offset:")) ) ); sb_off_x = memnew( SpinBox ); sb_off_x->set_min(-256); @@ -469,7 +469,7 @@ SpriteRegionEditor::SpriteRegionEditor(EditorNode* p_editor) hb_tools->add_child(sb_off_y); hb_tools->add_child( memnew( VSeparator )); - hb_tools->add_child( memnew( Label("Grid Step:") ) ); + hb_tools->add_child( memnew( Label(TTR("Grid Step:")) ) ); sb_step_x = memnew( SpinBox ); sb_step_x->set_min(-256); diff --git a/tools/editor/plugins/sprite_region_editor_plugin.h b/tools/editor/plugins/sprite_region_editor_plugin.h index 47cb210863..6fe235c2ea 100644 --- a/tools/editor/plugins/sprite_region_editor_plugin.h +++ b/tools/editor/plugins/sprite_region_editor_plugin.h @@ -119,7 +119,7 @@ class SpriteRegionEditorPlugin : public EditorPlugin EditorNode *editor; public: - virtual String get_name() const { return "SpriteRegion"; } + virtual String get_name() const { return TTR("SpriteRegion"); } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; diff --git a/tools/editor/plugins/stream_editor_plugin.h b/tools/editor/plugins/stream_editor_plugin.h index 5730612d61..90046a5fdf 100644 --- a/tools/editor/plugins/stream_editor_plugin.h +++ b/tools/editor/plugins/stream_editor_plugin.h @@ -69,7 +69,7 @@ class StreamEditorPlugin : public EditorPlugin { public: - virtual String get_name() const { return "Stream"; } + virtual String get_name() const { return TTR("Stream"); } bool has_main_screen() const { return false; } virtual void edit(Object *p_node); virtual bool handles(Object *p_node) const; diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp index f08d2a7376..d5c885bd55 100644 --- a/tools/editor/plugins/style_box_editor_plugin.cpp +++ b/tools/editor/plugins/style_box_editor_plugin.cpp @@ -61,7 +61,7 @@ StyleBoxEditor::StyleBoxEditor() { panel->set_area_as_parent_rect(); Label *l = memnew( Label ); - l->set_text("StyleBox Preview:"); + l->set_text(TTR("StyleBox Preview:")); l->set_pos(Point2(5,5)); panel->add_child(l); diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index e792a2a9e2..3c394ab6ac 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -199,7 +199,7 @@ void ThemeEditor::_save_template_cbk(String fname) { if (!file) { - ERR_EXPLAIN("Can't save theme to file: "+filename); + ERR_EXPLAIN(TTR("Can't save theme to file: ")+filename); return; } file->store_line("; ******************* "); @@ -473,16 +473,16 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { if (p_option==POPUP_ADD) {//add - add_del_dialog->set_title("Add Item"); - add_del_dialog->get_ok()->set_text("Add"); + add_del_dialog->set_title(TTR("Add Item")); + add_del_dialog->get_ok()->set_text(TTR("Add")); add_del_dialog->popup_centered(Size2(490,85)); base_theme=Theme::get_default(); } else if (p_option==POPUP_CLASS_ADD) {//add - add_del_dialog->set_title("Add All Items"); - add_del_dialog->get_ok()->set_text("Add All"); + add_del_dialog->set_title(TTR("Add All Items")); + add_del_dialog->get_ok()->set_text(TTR("Add All")); add_del_dialog->popup_centered(Size2(240,85)); base_theme=Theme::get_default(); @@ -495,8 +495,8 @@ void ThemeEditor::_theme_menu_cbk(int p_option) { } else if (p_option==POPUP_REMOVE) { - add_del_dialog->set_title("Remove Item"); - add_del_dialog->get_ok()->set_text("Remove"); + add_del_dialog->set_title(TTR("Remove Item")); + add_del_dialog->get_ok()->set_text(TTR("Remove")); add_del_dialog->popup_centered(Size2(490,85)); base_theme=theme; @@ -596,12 +596,12 @@ ThemeEditor::ThemeEditor() { theme_menu = memnew( MenuButton ); theme_menu->set_text("Theme"); - theme_menu->get_popup()->add_item("Add Item",POPUP_ADD); - theme_menu->get_popup()->add_item("Add Class Items",POPUP_CLASS_ADD); - theme_menu->get_popup()->add_item("Remove Item",POPUP_REMOVE); + theme_menu->get_popup()->add_item(TTR("Add Item"),POPUP_ADD); + theme_menu->get_popup()->add_item(TTR("Add Class Items"),POPUP_CLASS_ADD); + theme_menu->get_popup()->add_item(TTR("Remove Item"),POPUP_REMOVE); theme_menu->get_popup()->add_item("Remove Class Items",POPUP_CLASS_REMOVE); theme_menu->get_popup()->add_separator(); - theme_menu->get_popup()->add_item("Create Template",POPUP_CREATE_TEMPLATE); + theme_menu->get_popup()->add_item(TTR("Create Template"),POPUP_CREATE_TEMPLATE); hb_menu->add_child(theme_menu); theme_menu->get_popup()->connect("item_pressed", this,"_theme_menu_cbk"); @@ -640,30 +640,30 @@ ThemeEditor::ThemeEditor() { VBoxContainer *gbvb = memnew( VBoxContainer ); gbvb->set_v_size_flags(SIZE_EXPAND_FILL); CheckBox *rbx1 = memnew( CheckBox ); - rbx1->set_text("CheckBox Radio1"); + rbx1->set_text(TTR("CheckBox Radio1")); rbx1->set_pressed(true); gbvb->add_child(rbx1); CheckBox *rbx2 = memnew( CheckBox ); - rbx2->set_text("CheckBox Radio2"); + rbx2->set_text(TTR("CheckBox Radio2")); gbvb->add_child(rbx2); bg->add_child(gbvb); first_vb->add_child(bg); MenuButton* test_menu_button = memnew( MenuButton ); test_menu_button->set_text("MenuButton"); - test_menu_button->get_popup()->add_item("Item"); + test_menu_button->get_popup()->add_item(TTR("Item")); test_menu_button->get_popup()->add_separator(); - test_menu_button->get_popup()->add_check_item("Check Item"); - test_menu_button->get_popup()->add_check_item("Checked Item"); + test_menu_button->get_popup()->add_check_item(TTR("Check Item")); + test_menu_button->get_popup()->add_check_item(TTR("Checked Item")); test_menu_button->get_popup()->set_item_checked(2,true); first_vb->add_child(test_menu_button); OptionButton *test_option_button = memnew( OptionButton ); test_option_button->add_item("OptionButton"); test_option_button->add_separator(); - test_option_button->add_item("Has"); - test_option_button->add_item("Many"); - test_option_button->add_item("Options"); + test_option_button->add_item(TTR("Has")); + test_option_button->add_item(TTR("Many")); + test_option_button->add_item(TTR("Options")); first_vb->add_child(test_option_button); ColorPickerButton *cpb = memnew( ColorPickerButton ); @@ -714,7 +714,7 @@ ThemeEditor::ThemeEditor() { item = test_tree->create_item( test_tree->get_root() ); item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE); item->set_editable(0,true); - item->set_text(0,"Have,Many,Several,Options!"); + item->set_text(0,TTR("Have,Many,Several,Options!")); item->set_range(0,2); VBoxContainer *third_vb = memnew( VBoxContainer ); @@ -734,13 +734,13 @@ ThemeEditor::ThemeEditor() { third_vb->add_child(tc); tc->set_custom_minimum_size(Size2(0,160)); Control *tcc = memnew( Control ); - tcc->set_name("Tab 1"); + tcc->set_name(TTR("Tab 1")); tc->add_child(tcc); tcc = memnew( Control ); - tcc->set_name("Tab 2"); + tcc->set_name(TTR("Tab 2")); tc->add_child(tcc); tcc = memnew( Control ); - tcc->set_name("Tab 3"); + tcc->set_name(TTR("Tab 3")); tc->add_child(tcc); main_hb->add_constant_override("separation",20); @@ -757,7 +757,7 @@ ThemeEditor::ThemeEditor() { line_edit = memnew( LineEdit ); line_edit->set_pos( Point2( 25, 275 ) ); line_edit->set_size( Point2( 150, 5 ) ); - line_edit->set_text("Line Edit"); + line_edit->set_text(TTR("Line Edit")); panel->add_child(line_edit); test_v_scroll = memnew( VScrollBar ); @@ -786,12 +786,12 @@ ThemeEditor::ThemeEditor() { item = test_tree->create_item( test_tree->get_root() ); item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE); item->set_editable(0,true); - item->set_text(0,"Have,Many,Several,Options!"); + item->set_text(0,TTR("Have,Many,Several,Options!")); item->set_range(0,2); Button *fd_button= memnew( Button ); fd_button->set_pos(Point2(300,275)); - fd_button->set_text("Open File Dialog"); + fd_button->set_text(TTR("Open File Dialog")); panel->add_child(fd_button); test_file_dialog = memnew( EditorFileDialog ); @@ -807,7 +807,7 @@ ThemeEditor::ThemeEditor() { Label *l = memnew( Label ); l->set_pos( Point2(5,5) ); - l->set_text("Type:"); + l->set_text(TTR("Type:")); add_del_dialog->add_child(l); dtype_select_label=l; @@ -826,7 +826,7 @@ ThemeEditor::ThemeEditor() { l = memnew( Label ); l->set_pos( Point2(200,5) ); - l->set_text("Name:"); + l->set_text(TTR("Name:")); add_del_dialog->add_child(l); name_select_label=l; @@ -846,15 +846,15 @@ ThemeEditor::ThemeEditor() { type_select_label= memnew( Label ); type_select_label->set_pos( Point2(400,5) ); - type_select_label->set_text("Data Type:"); + type_select_label->set_text(TTR("Data Type:")); add_del_dialog->add_child(type_select_label); type_select = memnew( OptionButton ); - type_select->add_item("Icon"); - type_select->add_item("Style"); + type_select->add_item(TTR("Icon")); + type_select->add_item(TTR("Style")); type_select->add_item("Font"); type_select->add_item("Color"); - type_select->add_item("Constant"); + type_select->add_item(TTR("Constant")); type_select->set_pos( Point2( 400,25 ) ); type_select->set_size( Point2( 80,5 ) ); diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 30ec6c086c..843fc35d8b 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -581,7 +581,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { if (id!=TileMap::INVALID_CELL && paint_undo.size()) { - undo_redo->create_action("Paint TileMap"); + undo_redo->create_action(TTR("Paint TileMap")); for (Map<Point2i,CellOp>::Element *E=paint_undo.front();E;E=E->next()) { Point2 p=E->key(); @@ -630,7 +630,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { Point2 ofs = over_tile-rectangle.pos; - undo_redo->create_action("Duplicate"); + undo_redo->create_action(TTR("Duplicate")); for (List<TileData>::Element *E=copydata.front();E;E=E->next()) { _set_cell(E->get().pos+ofs,E->get().cell,E->get().flip_h,E->get().flip_v,E->get().transpose,true); @@ -725,7 +725,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { if (tool==TOOL_ERASING || tool==TOOL_RECTANGLE_ERASE || tool==TOOL_LINE_ERASE) { if (paint_undo.size()) { - undo_redo->create_action("Erase TileMap"); + undo_redo->create_action(TTR("Erase TileMap")); for (Map<Point2i,CellOp>::Element *E=paint_undo.front();E;E=E->next()) { Point2 p=E->key(); @@ -1323,7 +1323,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { p->add_item("Pick Tile", OPTION_PICK_TILE, KEY_CONTROL); p->add_separator(); p->add_item("Select", OPTION_SELECT, KEY_MASK_CMD+KEY_B); - p->add_item("Duplicate Selection", OPTION_DUPLICATE, KEY_MASK_CMD+KEY_D); + p->add_item(TTR("Duplicate Selection"), OPTION_DUPLICATE, KEY_MASK_CMD+KEY_D); p->add_item("Erase Selection", OPTION_ERASE_SELECTION, KEY_DELETE); p->connect("item_pressed", this, "_menu_option"); @@ -1334,19 +1334,19 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { transp = memnew( ToolButton ); transp->set_toggle_mode(true); - transp->set_tooltip("Transpose"); + transp->set_tooltip(TTR("Transpose")); transp->set_focus_mode(FOCUS_NONE); transp->connect("pressed", this, "_update_transform_buttons", make_binds(transp)); toolbar->add_child(transp); mirror_x = memnew( ToolButton ); mirror_x->set_toggle_mode(true); - mirror_x->set_tooltip("Mirror X (A)"); + mirror_x->set_tooltip(TTR("Mirror X (A)")); mirror_x->set_focus_mode(FOCUS_NONE); mirror_x->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_x)); toolbar->add_child(mirror_x); mirror_y = memnew( ToolButton ); mirror_y->set_toggle_mode(true); - mirror_y->set_tooltip("Mirror Y (S)"); + mirror_y->set_tooltip(TTR("Mirror Y (S)")); mirror_y->set_focus_mode(FOCUS_NONE); mirror_y->connect("pressed", this, "_update_transform_buttons", make_binds(mirror_y)); toolbar->add_child(mirror_y); @@ -1355,25 +1355,25 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { rotate_0 = memnew( ToolButton ); rotate_0->set_toggle_mode(true); - rotate_0->set_tooltip("Rotate 0 degrees"); + rotate_0->set_tooltip(TTR("Rotate 0 degrees")); rotate_0->set_focus_mode(FOCUS_NONE); rotate_0->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_0)); toolbar->add_child(rotate_0); rotate_90 = memnew( ToolButton ); rotate_90->set_toggle_mode(true); - rotate_90->set_tooltip("Rotate 90 degrees"); + rotate_90->set_tooltip(TTR("Rotate 90 degrees")); rotate_90->set_focus_mode(FOCUS_NONE); rotate_90->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_90)); toolbar->add_child(rotate_90); rotate_180 = memnew( ToolButton ); rotate_180->set_toggle_mode(true); - rotate_180->set_tooltip("Rotate 180 degrees"); + rotate_180->set_tooltip(TTR("Rotate 180 degrees")); rotate_180->set_focus_mode(FOCUS_NONE); rotate_180->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_180)); toolbar->add_child(rotate_180); rotate_270 = memnew( ToolButton ); rotate_270->set_toggle_mode(true); - rotate_270->set_tooltip("Rotate 270 degrees"); + rotate_270->set_tooltip(TTR("Rotate 270 degrees")); rotate_270->set_focus_mode(FOCUS_NONE); rotate_270->connect("pressed", this, "_update_transform_buttons", make_binds(rotate_270)); toolbar->add_child(rotate_270); diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index 06046b226a..b77d3fb5b3 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -175,7 +175,7 @@ void TileSetEditor::_name_dialog_confirm(const String& name) { if (tileset->has_tile(id)) { tileset->remove_tile(id); } else { - err_dialog->set_text("Could not find tile: " + name); + err_dialog->set_text(TTR("Could not find tile: ") + name); err_dialog->popup_centered(Size2(300, 60)); } } break; @@ -193,18 +193,18 @@ void TileSetEditor::_menu_cbk(int p_option) { } break; case MENU_OPTION_REMOVE_ITEM: { - nd->set_title("Remove Item"); - nd->set_text("Item name or ID:"); + nd->set_title(TTR("Remove Item")); + nd->set_text(TTR("Item name or ID:")); nd->popup_centered(Size2(300, 95)); } break; case MENU_OPTION_CREATE_FROM_SCENE: { - cd->set_text("Create from scene?"); + cd->set_text(TTR("Create from scene?")); cd->popup_centered(Size2(300,60)); } break; case MENU_OPTION_MERGE_FROM_SCENE: { - cd->set_text("Merge from scene?"); + cd->set_text(TTR("Merge from scene?")); cd->popup_centered(Size2(300,60)); } break; } @@ -235,11 +235,11 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { panel->add_child(options); options->set_pos(Point2(1,1)); options->set_text("Theme"); - options->get_popup()->add_item("Add Item",MENU_OPTION_ADD_ITEM); - options->get_popup()->add_item("Remove Item",MENU_OPTION_REMOVE_ITEM); + options->get_popup()->add_item(TTR("Add Item"),MENU_OPTION_ADD_ITEM); + options->get_popup()->add_item(TTR("Remove Item"),MENU_OPTION_REMOVE_ITEM); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create from Scene",MENU_OPTION_CREATE_FROM_SCENE); - options->get_popup()->add_item("Merge from Scene",MENU_OPTION_MERGE_FROM_SCENE); + options->get_popup()->add_item(TTR("Create from Scene"),MENU_OPTION_CREATE_FROM_SCENE); + options->get_popup()->add_item(TTR("Merge from Scene"),MENU_OPTION_MERGE_FROM_SCENE); options->get_popup()->connect("item_pressed", this,"_menu_cbk"); editor=p_editor; cd = memnew(ConfirmationDialog); @@ -254,7 +254,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { err_dialog = memnew(AcceptDialog); add_child(err_dialog); - err_dialog->set_title("Error"); + err_dialog->set_title(TTR("Error")); } void TileSetEditorPlugin::edit(Object *p_node) { |