diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-08-23 22:25:14 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-08-25 18:49:45 +0200 |
commit | 6134d8741d6b255751e7b2811be85b60ef916269 (patch) | |
tree | 27edc499e4ecced86630715232f7adfa62f9b3c4 /modules | |
parent | a1c03a69d2940fb69d7221800e919f4a183fec0c (diff) |
Editor: Add some more translatable strings.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 58 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 36 |
2 files changed, 47 insertions, 47 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 8c56da4492..75610fc005 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -403,7 +403,7 @@ void GridMapEditor::_delete_selection() { if (!selection.active) return; - undo_redo->create_action("GridMap Delete Selection"); + undo_redo->create_action(TTR("GridMap Delete Selection")); for (int i = selection.begin.x; i <= selection.end.x; i++) { for (int j = selection.begin.y; j <= selection.end.y; j++) { @@ -487,7 +487,7 @@ void GridMapEditor::_duplicate_paste() { Vector3 ofs = selection.current - selection.click; if (items.size()) { - undo_redo->create_action("GridMap Duplicate Selection"); + undo_redo->create_action(TTR("GridMap Duplicate Selection")); for (List<__Item>::Element *E = items.front(); E; E = E->next()) { __Item &it = E->get(); Vector3 pos = it.pos + ofs; @@ -568,7 +568,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu (mb->get_button_index() == BUTTON_LEFT && input_action == INPUT_PAINT)) { if (set_items.size()) { - undo_redo->create_action("GridMap Paint"); + undo_redo->create_action(TTR("GridMap Paint")); for (List<SetItem>::Element *E = set_items.front(); E; E = E->next()) { const SetItem &si = E->get(); @@ -1142,45 +1142,45 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { spatial_editor_hb->hide(); options->set_text("Grid"); - options->get_popup()->add_check_item("Snap View", MENU_OPTION_LOCK_VIEW); + options->get_popup()->add_check_item(TTR("Snap View"), MENU_OPTION_LOCK_VIEW); options->get_popup()->add_separator(); - options->get_popup()->add_item("Prev Level (" + keycode_get_string(KEY_MASK_CMD) + "Down Wheel)", MENU_OPTION_PREV_LEVEL); - options->get_popup()->add_item("Next Level (" + keycode_get_string(KEY_MASK_CMD) + "Up Wheel)", MENU_OPTION_NEXT_LEVEL); + options->get_popup()->add_item(TTR("Prev Level (") + keycode_get_string(KEY_MASK_CMD) + TTR("Down Wheel)"), MENU_OPTION_PREV_LEVEL); + options->get_popup()->add_item(TTR("Next Level (") + keycode_get_string(KEY_MASK_CMD) + TTR("Up Wheel)"), MENU_OPTION_NEXT_LEVEL); options->get_popup()->add_separator(); - options->get_popup()->add_check_item("Clip Disabled", MENU_OPTION_CLIP_DISABLED); + options->get_popup()->add_check_item(TTR("Clip Disabled"), MENU_OPTION_CLIP_DISABLED); options->get_popup()->set_item_checked(options->get_popup()->get_item_index(MENU_OPTION_CLIP_DISABLED), true); - options->get_popup()->add_check_item("Clip Above", MENU_OPTION_CLIP_ABOVE); - options->get_popup()->add_check_item("Clip Below", MENU_OPTION_CLIP_BELOW); + options->get_popup()->add_check_item(TTR("Clip Above"), MENU_OPTION_CLIP_ABOVE); + options->get_popup()->add_check_item(TTR("Clip Below"), MENU_OPTION_CLIP_BELOW); options->get_popup()->add_separator(); - options->get_popup()->add_check_item("Edit X Axis", MENU_OPTION_X_AXIS, KEY_Z); - options->get_popup()->add_check_item("Edit Y Axis", MENU_OPTION_Y_AXIS, KEY_X); - options->get_popup()->add_check_item("Edit Z Axis", MENU_OPTION_Z_AXIS, KEY_C); + options->get_popup()->add_check_item(TTR("Edit X Axis"), MENU_OPTION_X_AXIS, KEY_Z); + options->get_popup()->add_check_item(TTR("Edit Y Axis"), MENU_OPTION_Y_AXIS, KEY_X); + options->get_popup()->add_check_item(TTR("Edit Z Axis"), MENU_OPTION_Z_AXIS, KEY_C); options->get_popup()->set_item_checked(options->get_popup()->get_item_index(MENU_OPTION_Y_AXIS), true); options->get_popup()->add_separator(); - options->get_popup()->add_item("Cursor Rotate X", MENU_OPTION_CURSOR_ROTATE_X, KEY_A); - options->get_popup()->add_item("Cursor Rotate Y", MENU_OPTION_CURSOR_ROTATE_Y, KEY_S); - options->get_popup()->add_item("Cursor Rotate Z", MENU_OPTION_CURSOR_ROTATE_Z, KEY_D); - options->get_popup()->add_item("Cursor Back Rotate X", MENU_OPTION_CURSOR_BACK_ROTATE_X, KEY_MASK_SHIFT + KEY_A); - options->get_popup()->add_item("Cursor Back Rotate Y", MENU_OPTION_CURSOR_BACK_ROTATE_Y, KEY_MASK_SHIFT + KEY_S); - options->get_popup()->add_item("Cursor Back Rotate Z", MENU_OPTION_CURSOR_BACK_ROTATE_Z, KEY_MASK_SHIFT + KEY_D); - options->get_popup()->add_item("Cursor Clear Rotation", MENU_OPTION_CURSOR_CLEAR_ROTATION, KEY_W); + options->get_popup()->add_item(TTR("Cursor Rotate X"), MENU_OPTION_CURSOR_ROTATE_X, KEY_A); + options->get_popup()->add_item(TTR("Cursor Rotate Y"), MENU_OPTION_CURSOR_ROTATE_Y, KEY_S); + options->get_popup()->add_item(TTR("Cursor Rotate Z"), MENU_OPTION_CURSOR_ROTATE_Z, KEY_D); + options->get_popup()->add_item(TTR("Cursor Back Rotate X"), MENU_OPTION_CURSOR_BACK_ROTATE_X, KEY_MASK_SHIFT + KEY_A); + options->get_popup()->add_item(TTR("Cursor Back Rotate Y"), MENU_OPTION_CURSOR_BACK_ROTATE_Y, KEY_MASK_SHIFT + KEY_S); + options->get_popup()->add_item(TTR("Cursor Back Rotate Z"), MENU_OPTION_CURSOR_BACK_ROTATE_Z, KEY_MASK_SHIFT + KEY_D); + options->get_popup()->add_item(TTR("Cursor Clear Rotation"), MENU_OPTION_CURSOR_CLEAR_ROTATION, KEY_W); options->get_popup()->add_separator(); options->get_popup()->add_check_item("Duplicate Selects", MENU_OPTION_DUPLICATE_SELECTS); options->get_popup()->add_separator(); - options->get_popup()->add_item("Create Area", MENU_OPTION_SELECTION_MAKE_AREA, KEY_CONTROL + KEY_C); - options->get_popup()->add_item("Create Exterior Connector", MENU_OPTION_SELECTION_MAKE_EXTERIOR_CONNECTOR); - options->get_popup()->add_item("Erase Area", MENU_OPTION_REMOVE_AREA); + options->get_popup()->add_item(TTR("Create Area"), MENU_OPTION_SELECTION_MAKE_AREA, KEY_CONTROL + KEY_C); + options->get_popup()->add_item(TTR("Create Exterior Connector"), MENU_OPTION_SELECTION_MAKE_EXTERIOR_CONNECTOR); + options->get_popup()->add_item(TTR("Erase Area"), MENU_OPTION_REMOVE_AREA); options->get_popup()->add_separator(); - options->get_popup()->add_item("Selection -> Duplicate", MENU_OPTION_SELECTION_DUPLICATE, KEY_MASK_SHIFT + KEY_INSERT); - options->get_popup()->add_item("Selection -> Clear", MENU_OPTION_SELECTION_CLEAR, KEY_MASK_SHIFT + KEY_DELETE); + options->get_popup()->add_item(TTR("Selection -> Duplicate"), MENU_OPTION_SELECTION_DUPLICATE, KEY_MASK_SHIFT + KEY_INSERT); + options->get_popup()->add_item(TTR("Selection -> Clear"), MENU_OPTION_SELECTION_CLEAR, KEY_MASK_SHIFT + KEY_DELETE); //options->get_popup()->add_separator(); //options->get_popup()->add_item("Configure",MENU_OPTION_CONFIGURE); options->get_popup()->add_separator(); - options->get_popup()->add_item("Settings", MENU_OPTION_GRIDMAP_SETTINGS); + options->get_popup()->add_item(TTR("Settings"), MENU_OPTION_GRIDMAP_SETTINGS); settings_dialog = memnew(ConfirmationDialog); - settings_dialog->set_title("GridMap Settings"); + settings_dialog->set_title(TTR("GridMap Settings")); add_child(settings_dialog); settings_vbc = memnew(VBoxContainer); settings_vbc->set_custom_minimum_size(Size2(200, 0)); @@ -1191,7 +1191,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { settings_pick_distance->set_min(500.0f); settings_pick_distance->set_step(1.0f); settings_pick_distance->set_value(EDITOR_DEF("editors/grid_map/pick_distance", 5000.0)); - settings_vbc->add_margin_child("Pick Distance:", settings_pick_distance); + settings_vbc->add_margin_child(TTR("Pick Distance:"), settings_pick_distance); clip_mode = CLIP_DISABLED; options->get_popup()->connect("id_pressed", this, "_menu_option"); @@ -1204,8 +1204,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { edit_mode->set_area_as_parent_rect(); edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24); edit_mode->set_margin(MARGIN_RIGHT, -14); - edit_mode->add_item("Tiles"); - edit_mode->add_item("Areas"); + edit_mode->add_item(TTR("Tiles")); + edit_mode->add_item(TTR("Areas")); hb->add_child(edit_mode); edit_mode->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 61c21227fa..e93d6ec4d1 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -73,7 +73,7 @@ protected: if (argc == new_argc) return true; - undo_redo->create_action("Change Signal Arguments"); + undo_redo->create_action(TTR("Change Signal Arguments")); if (new_argc < argc) { for (int i = new_argc; i < argc; i++) { @@ -104,7 +104,7 @@ protected: int old_type = script->custom_signal_get_argument_type(sig, idx); int new_type = p_value; - undo_redo->create_action("Change Argument Type"); + undo_redo->create_action(TTR("Change Argument Type")); undo_redo->add_do_method(script.ptr(), "custom_signal_set_argument_type", sig, idx, new_type); undo_redo->add_undo_method(script.ptr(), "custom_signal_set_argument_type", sig, idx, old_type); undo_redo->commit_action(); @@ -116,7 +116,7 @@ protected: String old_name = script->custom_signal_get_argument_name(sig, idx); String new_name = p_value; - undo_redo->create_action("Change Argument name"); + undo_redo->create_action(TTR("Change Argument name")); undo_redo->add_do_method(script.ptr(), "custom_signal_set_argument_name", sig, idx, new_name); undo_redo->add_undo_method(script.ptr(), "custom_signal_set_argument_name", sig, idx, old_name); undo_redo->commit_action(); @@ -213,7 +213,7 @@ protected: return false; if (String(p_name) == "value") { - undo_redo->create_action("Set Variable Default Value"); + undo_redo->create_action(TTR("Set Variable Default Value")); Variant current = script->get_variable_default_value(var); undo_redo->add_do_method(script.ptr(), "set_variable_default_value", var, p_value); undo_redo->add_undo_method(script.ptr(), "set_variable_default_value", var, current); @@ -229,7 +229,7 @@ protected: Dictionary dc = d.copy(); dc["type"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -242,7 +242,7 @@ protected: Dictionary dc = d.copy(); dc["hint"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -255,7 +255,7 @@ protected: Dictionary dc = d.copy(); dc["hint_string"] = p_value; - undo_redo->create_action("Set Variable Type"); + undo_redo->create_action(TTR("Set Variable Type")); undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc); undo_redo->add_undo_method(script.ptr(), "set_variable_info", var, d); undo_redo->add_do_method(this, "_var_changed"); @@ -1264,7 +1264,7 @@ void VisualScriptEditor::_on_nodes_delete() { if (to_erase.empty()) return; - undo_redo->create_action("Remove VisualScript Nodes"); + undo_redo->create_action(TTR("Remove VisualScript Nodes")); for (List<int>::Element *F = to_erase.front(); F; F = F->next()) { @@ -1313,7 +1313,7 @@ void VisualScriptEditor::_on_nodes_duplicate() { if (to_duplicate.empty()) return; - undo_redo->create_action("Duplicate VisualScript Nodes"); + undo_redo->create_action(TTR("Duplicate VisualScript Nodes")); int idc = script->get_available_id() + 1; Set<int> to_select; @@ -2208,7 +2208,7 @@ void VisualScriptEditor::_change_base_type_callback() { String bt = select_base_type->get_selected_type(); ERR_FAIL_COND(bt == String()); - undo_redo->create_action("Change Base Type"); + undo_redo->create_action(TTR("Change Base Type")); undo_redo->add_do_method(script.ptr(), "set_instance_base_type", bt); undo_redo->add_undo_method(script.ptr(), "set_instance_base_type", script->get_instance_base_type()); undo_redo->add_do_method(this, "_update_members"); @@ -2256,7 +2256,7 @@ static bool _get_in_slot(const Ref<VisualScriptNode> &p_node, int p_slot, int &r void VisualScriptEditor::_begin_node_move() { - undo_redo->create_action("Move Node(s)"); + undo_redo->create_action(TTR("Move Node(s)")); } void VisualScriptEditor::_end_node_move() { @@ -2282,7 +2282,7 @@ void VisualScriptEditor::_node_moved(Vector2 p_from, Vector2 p_to, int p_id) { void VisualScriptEditor::_remove_node(int p_id) { - undo_redo->create_action("Remove VisualScript Node"); + undo_redo->create_action(TTR("Remove VisualScript Node")); undo_redo->add_do_method(script.ptr(), "remove_node", edited_func, p_id); undo_redo->add_undo_method(script.ptr(), "add_node", edited_func, p_id, script->get_node(edited_func, p_id), script->get_node_pos(edited_func, p_id)); @@ -2343,7 +2343,7 @@ void VisualScriptEditor::_graph_connected(const String &p_from, int p_from_slot, ERR_FAIL_COND(from_seq != to_seq); - undo_redo->create_action("Connect Nodes"); + undo_redo->create_action(TTR("Connect Nodes")); if (from_seq) { undo_redo->add_do_method(script.ptr(), "sequence_connect", edited_func, p_from.to_int(), from_port, p_to.to_int()); @@ -2396,7 +2396,7 @@ void VisualScriptEditor::_graph_disconnected(const String &p_from, int p_from_sl ERR_FAIL_COND(from_seq != to_seq); - undo_redo->create_action("Connect Nodes"); + undo_redo->create_action(TTR("Connect Nodes")); if (from_seq) { undo_redo->add_do_method(script.ptr(), "sequence_disconnect", edited_func, p_from.to_int(), from_port, p_to.to_int()); @@ -2723,7 +2723,7 @@ void VisualScriptEditor::_default_value_changed() { if (vsn.is_null()) return; - undo_redo->create_action("Change Input Value"); + undo_redo->create_action(TTR("Change Input Value")); undo_redo->add_do_method(vsn.ptr(), "set_default_input_value", editing_input, default_value_edit->get_variant()); undo_redo->add_undo_method(vsn.ptr(), "set_default_input_value", editing_input, vsn->get_default_input_value(editing_input)); @@ -2886,7 +2886,7 @@ void VisualScriptEditor::_menu_option(int p_what) { int id = String(gn->get_name()).to_int(); Ref<VisualScriptNode> node = script->get_node(edited_func, id); if (Object::cast_to<VisualScriptFunction>(*node)) { - EditorNode::get_singleton()->show_warning("Can't copy the function node."); + EditorNode::get_singleton()->show_warning(TTR("Can't copy the function node.")); return; } if (node.is_valid()) { @@ -2934,13 +2934,13 @@ void VisualScriptEditor::_menu_option(int p_what) { break; if (clipboard->nodes.empty()) { - EditorNode::get_singleton()->show_warning("Clipboard is empty!"); + EditorNode::get_singleton()->show_warning(TTR("Clipboard is empty!")); break; } Map<int, int> remap; - undo_redo->create_action("Paste VisualScript Nodes"); + undo_redo->create_action(TTR("Paste VisualScript Nodes")); int idc = script->get_available_id() + 1; Set<int> to_select; |