diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 33aa76fa945..6a29cf8888f 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -98,7 +98,7 @@ public: VBoxContainer *container; GridContainer *child_container; - set_title(TTR("Configure Snap")); + set_title(TTRC("Configure Snap")); container = memnew(VBoxContainer); add_child(container); @@ -108,7 +108,7 @@ public: container->add_child(child_container); label = memnew(Label); - label->set_text(TTR("Grid Offset:")); + label->set_text(TTRC("Grid Offset:")); child_container->add_child(label); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -135,7 +135,7 @@ public: child_container->add_child(grid_offset_y); label = memnew(Label); - label->set_text(TTR("Grid Step:")); + label->set_text(TTRC("Grid Step:")); child_container->add_child(label); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -160,7 +160,7 @@ public: child_container->add_child(grid_step_y); label = memnew(Label); - label->set_text(TTR("Primary Line Every:")); + label->set_text(TTRC("Primary Line Every:")); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); child_container->add_child(label); @@ -180,7 +180,7 @@ public: primary_grid_step_y->set_step(1); primary_grid_step_y->set_max(SPIN_BOX_GRID_RANGE); primary_grid_step_y->set_allow_greater(true); - primary_grid_step_y->set_suffix("steps"); + primary_grid_step_y->set_suffix(TTRC("steps")); // TODO: Add suffix auto-translation. primary_grid_step_y->set_h_size_flags(Control::SIZE_EXPAND_FILL); primary_grid_step_y->set_select_all_on_focus(true); primary_grid_step_y->set_accessibility_name(TTRC("Y Primary Step")); @@ -195,28 +195,28 @@ public: container->add_child(child_container); label = memnew(Label); - label->set_text(TTR("Rotation Offset:")); + label->set_text(TTRC("Rotation Offset:")); child_container->add_child(label); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_offset = memnew(SpinBox); rotation_offset->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_offset->set_max(SPIN_BOX_ROTATION_RANGE); - rotation_offset->set_suffix("deg"); + rotation_offset->set_suffix(U"°"); rotation_offset->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_offset->set_select_all_on_focus(true); rotation_offset->set_accessibility_name(TTRC("Rotation Offset")); child_container->add_child(rotation_offset); label = memnew(Label); - label->set_text(TTR("Rotation Step:")); + label->set_text(TTRC("Rotation Step:")); child_container->add_child(label); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_step = memnew(SpinBox); rotation_step->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_step->set_max(SPIN_BOX_ROTATION_RANGE); - rotation_step->set_suffix("deg"); + rotation_step->set_suffix(U"°"); rotation_step->set_h_size_flags(Control::SIZE_EXPAND_FILL); rotation_step->set_select_all_on_focus(true); rotation_step->set_accessibility_name(TTRC("Rotation Step")); @@ -228,7 +228,7 @@ public: child_container->set_columns(2); container->add_child(child_container); label = memnew(Label); - label->set_text(TTR("Scale Step:")); + label->set_text(TTRC("Scale Step:")); child_container->add_child(label); label->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -2479,17 +2479,17 @@ bool CanvasItemEditor::_gui_input_select(const Ref &p_event) { if (b.is_valid() && b->is_pressed() && b->get_button_index() == MouseButton::RIGHT) { add_node_menu->clear(); - add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("Add")), TTR("Add Node Here..."), ADD_NODE); - add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("Instance")), TTR("Instantiate Scene Here..."), ADD_INSTANCE); + add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("Add")), TTRC("Add Node Here..."), ADD_NODE); + add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("Instance")), TTRC("Instantiate Scene Here..."), ADD_INSTANCE); for (Node *node : SceneTreeDock::get_singleton()->get_node_clipboard()) { if (Object::cast_to(node)) { - add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("ActionPaste")), TTR("Paste Node(s) Here"), ADD_PASTE); + add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("ActionPaste")), TTRC("Paste Node(s) Here"), ADD_PASTE); break; } } for (Node *node : EditorNode::get_singleton()->get_editor_selection()->get_top_selected_node_list()) { if (Object::cast_to(node)) { - add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("ToolMove")), TTR("Move Node(s) Here"), ADD_MOVE); + add_node_menu->add_icon_item(get_editor_theme_icon(SNAME("ToolMove")), TTRC("Move Node(s) Here"), ADD_MOVE); break; } } @@ -4140,6 +4140,11 @@ void CanvasItemEditor::_project_settings_changed() { void CanvasItemEditor::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + select_button->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+Drag: Scale selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)") + "\n" + TTR("RMB: Add node at position clicked.")); + pivot_button->set_tooltip_text(TTR("Click to change object's pivot.") + "\n" + TTR("Shift: Set temporary pivot.") + "\n" + TTR("Click this button while holding Shift to put the temporary pivot in the center of the selected nodes.")); + } break; + case NOTIFICATION_READY: { _update_lock_and_group_button(); @@ -5430,6 +5435,7 @@ CanvasItemEditor::CanvasItemEditor() { viewport->add_child(controls_vb); select_button = memnew(Button); + select_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); select_button->set_theme_type_variation(SceneStringName(FlatButton)); main_menu_hbox->add_child(select_button); select_button->set_toggle_mode(true); @@ -5437,7 +5443,6 @@ CanvasItemEditor::CanvasItemEditor() { select_button->set_pressed(true); select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTRC("Select Mode"), Key::Q, true)); select_button->set_shortcut_context(this); - select_button->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+Drag: Scale selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)") + "\n" + TTR("RMB: Add node at position clicked.")); select_button->set_accessibility_name(TTRC("Select Mode")); main_menu_hbox->add_child(memnew(VSeparator)); @@ -5479,15 +5484,15 @@ CanvasItemEditor::CanvasItemEditor() { main_menu_hbox->add_child(list_select_button); list_select_button->set_toggle_mode(true); list_select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT)); - list_select_button->set_tooltip_text(TTR("Show list of selectable nodes at position clicked.")); + list_select_button->set_tooltip_text(TTRC("Show list of selectable nodes at position clicked.")); list_select_button->set_accessibility_name(TTRC("List Selectable Nodes")); pivot_button = memnew(Button); + pivot_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); pivot_button->set_theme_type_variation(SceneStringName(FlatButton)); main_menu_hbox->add_child(pivot_button); pivot_button->set_toggle_mode(true); pivot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT)); - pivot_button->set_tooltip_text(TTR("Click to change object's pivot.") + "\n" + TTR("Shift: Set temporary pivot.") + "\n" + TTR("Click this button while holding Shift to put the temporary pivot in the center of the selected nodes.")); pivot_button->set_accessibility_name(TTRC("Change Pivot")); pan_button = memnew(Button); @@ -5538,7 +5543,7 @@ CanvasItemEditor::CanvasItemEditor() { snap_config_menu->set_shortcut_context(this); main_menu_hbox->add_child(snap_config_menu); snap_config_menu->set_h_size_flags(SIZE_SHRINK_END); - snap_config_menu->set_tooltip_text(TTR("Snapping Options")); + snap_config_menu->set_tooltip_text(TTRC("Snapping Options")); snap_config_menu->set_switch_on_hover(true); snap_config_menu->set_accessibility_name(TTRC("Snapping Options")); @@ -5559,7 +5564,7 @@ CanvasItemEditor::CanvasItemEditor() { smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_node_center", TTRC("Snap to Node Center")), SNAP_USE_NODE_CENTER); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_other_nodes", TTRC("Snap to Other Nodes")), SNAP_USE_OTHER_NODES); smartsnap_config_popup->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/snap_guides", TTRC("Snap to Guides")), SNAP_USE_GUIDES); - p->add_submenu_node_item(TTR("Smart Snapping"), smartsnap_config_popup); + p->add_submenu_node_item(TTRC("Smart Snapping"), smartsnap_config_popup); p->add_separator(); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/configure_snap", TTRC("Configure Snap...")), SNAP_CONFIGURE); @@ -5610,7 +5615,7 @@ CanvasItemEditor::CanvasItemEditor() { skeleton_menu->set_theme_type_variation("FlatMenuButton"); skeleton_menu->set_shortcut_context(this); main_menu_hbox->add_child(skeleton_menu); - skeleton_menu->set_tooltip_text(TTR("Skeleton Options")); + skeleton_menu->set_tooltip_text(TTRC("Skeleton Options")); skeleton_menu->set_switch_on_hover(true); skeleton_menu->set_accessibility_name(TTRC("Skeleton Options")); @@ -5627,7 +5632,7 @@ CanvasItemEditor::CanvasItemEditor() { view_menu->set_flat(false); view_menu->set_theme_type_variation("FlatMenuButton"); // TRANSLATORS: Noun, name of the 2D/3D View menus. - view_menu->set_text(TTR("View")); + view_menu->set_text(TTRC("View")); view_menu->set_switch_on_hover(true); view_menu->set_shortcut_context(this); main_menu_hbox->add_child(view_menu); @@ -5640,12 +5645,12 @@ CanvasItemEditor::CanvasItemEditor() { grid_menu = memnew(PopupMenu); grid_menu->connect("about_to_popup", callable_mp(this, &CanvasItemEditor::_prepare_grid_menu)); grid_menu->connect(SceneStringName(id_pressed), callable_mp(this, &CanvasItemEditor::_on_grid_menu_id_pressed)); - grid_menu->add_radio_check_item(TTR("Show"), GRID_VISIBILITY_SHOW); - grid_menu->add_radio_check_item(TTR("Show When Snapping"), GRID_VISIBILITY_SHOW_WHEN_SNAPPING); - grid_menu->add_radio_check_item(TTR("Hide"), GRID_VISIBILITY_HIDE); + grid_menu->add_radio_check_item(TTRC("Show"), GRID_VISIBILITY_SHOW); + grid_menu->add_radio_check_item(TTRC("Show When Snapping"), GRID_VISIBILITY_SHOW_WHEN_SNAPPING); + grid_menu->add_radio_check_item(TTRC("Hide"), GRID_VISIBILITY_HIDE); grid_menu->add_separator(); grid_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/toggle_grid", TTRC("Toggle Grid"), KeyModifierMask::CMD_OR_CTRL | Key::APOSTROPHE)); - p->add_submenu_node_item(TTR("Grid"), grid_menu); + p->add_submenu_node_item(TTRC("Grid"), grid_menu); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_helpers", TTRC("Show Helpers"), Key::H), SHOW_HELPERS); p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_rulers", TTRC("Show Rulers")), SHOW_RULERS); @@ -5663,7 +5668,7 @@ CanvasItemEditor::CanvasItemEditor() { gizmos_menu->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_group_gizmos", TTRC("Group")), SHOW_GROUP_GIZMOS); gizmos_menu->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_transformation_gizmos", TTRC("Transformation")), SHOW_TRANSFORMATION_GIZMOS); p->add_child(gizmos_menu); - p->add_submenu_item(TTR("Gizmos"), "GizmosMenu"); + p->add_submenu_item(TTRC("Gizmos"), "GizmosMenu"); p->add_separator(); p->add_shortcut(ED_SHORTCUT("canvas_item_editor/center_selection", TTRC("Center Selection"), Key::F), VIEW_CENTER_TO_SELECTION); @@ -5674,10 +5679,10 @@ CanvasItemEditor::CanvasItemEditor() { theme_menu = memnew(PopupMenu); theme_menu->connect(SceneStringName(id_pressed), callable_mp(this, &CanvasItemEditor::_switch_theme_preview)); - theme_menu->add_radio_check_item(TTR("Project theme"), THEME_PREVIEW_PROJECT); - theme_menu->add_radio_check_item(TTR("Editor theme"), THEME_PREVIEW_EDITOR); - theme_menu->add_radio_check_item(TTR("Default theme"), THEME_PREVIEW_DEFAULT); - p->add_submenu_node_item(TTR("Preview Theme"), theme_menu); + theme_menu->add_radio_check_item(TTRC("Project theme"), THEME_PREVIEW_PROJECT); + theme_menu->add_radio_check_item(TTRC("Editor theme"), THEME_PREVIEW_EDITOR); + theme_menu->add_radio_check_item(TTRC("Default theme"), THEME_PREVIEW_DEFAULT); + p->add_submenu_node_item(TTRC("Preview Theme"), theme_menu); theme_preview = (ThemePreviewMode)(int)EditorSettings::get_singleton()->get_project_metadata("2d_editor", "theme_preview", THEME_PREVIEW_PROJECT); for (int i = 0; i < THEME_PREVIEW_MAX; i++) { @@ -5705,7 +5710,7 @@ CanvasItemEditor::CanvasItemEditor() { key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); key_loc_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_POS)); - key_loc_button->set_tooltip_text(TTR("Translation mask for inserting keys.")); + key_loc_button->set_tooltip_text(TTRC("Translation mask for inserting keys.")); key_loc_button->set_accessibility_name(TTRC("Translation Mask")); animation_hb->add_child(key_loc_button); @@ -5715,7 +5720,7 @@ CanvasItemEditor::CanvasItemEditor() { key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); key_rot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_ROT)); - key_rot_button->set_tooltip_text(TTR("Rotation mask for inserting keys.")); + key_rot_button->set_tooltip_text(TTRC("Rotation mask for inserting keys.")); key_rot_button->set_accessibility_name(TTRC("Rotation Mask")); animation_hb->add_child(key_rot_button); @@ -5724,7 +5729,7 @@ CanvasItemEditor::CanvasItemEditor() { key_scale_button->set_toggle_mode(true); key_scale_button->set_focus_mode(FOCUS_NONE); key_scale_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE)); - key_scale_button->set_tooltip_text(TTR("Scale mask for inserting keys.")); + key_scale_button->set_tooltip_text(TTRC("Scale mask for inserting keys.")); key_scale_button->set_accessibility_name(TTRC("Scale Mask")); animation_hb->add_child(key_scale_button); @@ -5752,7 +5757,7 @@ CanvasItemEditor::CanvasItemEditor() { animation_menu->set_flat(false); animation_menu->set_theme_type_variation("FlatMenuButton"); animation_menu->set_shortcut_context(this); - animation_menu->set_tooltip_text(TTR("Animation Key and Pose Options")); + animation_menu->set_tooltip_text(TTRC("Animation Key and Pose Options")); animation_menu->set_accessibility_name(TTRC("Animation Key and Pose")); animation_hb->add_child(animation_menu); animation_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &CanvasItemEditor::_popup_callback)); @@ -6427,7 +6432,6 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_it texture_node_type_selector = memnew(AcceptDialog); EditorNode::get_singleton()->get_gui_base()->add_child(texture_node_type_selector); - texture_node_type_selector->set_title(TTR("Change Default Type")); texture_node_type_selector->connect(SceneStringName(confirmed), callable_mp(this, &CanvasItemEditorViewport::_on_change_type_confirmed)); texture_node_type_selector->connect("canceled", callable_mp(this, &CanvasItemEditorViewport::_on_change_type_closed)); @@ -6444,10 +6448,11 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_it button_group.instantiate(); for (int i = 0; i < texture_node_types.size(); i++) { CheckBox *check = memnew(CheckBox); - btn_group->add_child(check); check->set_text(texture_node_types[i]); - check->connect("button_down", callable_mp(this, &CanvasItemEditorViewport::_on_select_texture_node_type).bind(check)); + check->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); check->set_button_group(button_group); + btn_group->add_child(check); + check->connect("button_down", callable_mp(this, &CanvasItemEditorViewport::_on_select_texture_node_type).bind(check)); } label = memnew(Label); diff --git a/editor/plugins/game_view_plugin.cpp b/editor/plugins/game_view_plugin.cpp index d39139d21fb..43ef9413db7 100644 --- a/editor/plugins/game_view_plugin.cpp +++ b/editor/plugins/game_view_plugin.cpp @@ -386,7 +386,7 @@ void GameView::_embedding_completed() { } void GameView::_embedding_failed() { - state_label->set_text(TTR("Connection impossible to the game process.")); + state_label->set_text(TTRC("Connection impossible to the game process.")); } void GameView::_embedded_process_updated() { @@ -555,20 +555,20 @@ void GameView::_update_ui() { state_label->set_text(""); show_game_size = true; } else if (embedded_process->is_embedding_in_progress()) { - state_label->set_text(TTR("Game starting...")); + state_label->set_text(TTRC("Game starting...")); } else if (EditorRunBar::get_singleton()->is_playing()) { - state_label->set_text(TTR("Game running not embedded.")); + state_label->set_text(TTRC("Game running not embedded.")); } else if (embed_on_play) { - state_label->set_text(TTR("Press play to start the game.")); + state_label->set_text(TTRC("Press play to start the game.")); } else { - state_label->set_text(TTR("Embedding is disabled.")); + state_label->set_text(TTRC("Embedding is disabled.")); } break; case EMBED_NOT_AVAILABLE_FEATURE_NOT_SUPPORTED: if (DisplayServer::get_singleton()->get_name() == "Wayland") { - state_label->set_text(TTR("Game embedding not available on Wayland.\nWayland can be disabled in the Editor Settings (Run > Platforms > Linux/*BSD > Prefer Wayland).")); + state_label->set_text(TTRC("Game embedding not available on Wayland.\nWayland can be disabled in the Editor Settings (Run > Platforms > Linux/*BSD > Prefer Wayland).")); } else { - state_label->set_text(TTR("Game embedding not available on your OS.")); + state_label->set_text(TTRC("Game embedding not available on your OS.")); } break; case EMBED_NOT_AVAILABLE_PROJECT_DISPLAY_DRIVER: @@ -584,7 +584,7 @@ void GameView::_update_ui() { state_label->set_text(TTR("Game embedding not available when the game starts in fullscreen.") + "\n" + TTR("Consider overriding the window mode project setting with the editor feature tag to Windowed to use game embedding while leaving the exported project intact.")); break; case EMBED_NOT_AVAILABLE_SINGLE_WINDOW_MODE: - state_label->set_text(TTR("Game embedding not available in single window mode.")); + state_label->set_text(TTRC("Game embedding not available in single window mode.")); break; } @@ -692,6 +692,11 @@ void GameView::_camera_override_menu_id_pressed(int p_id) { void GameView::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+RMB: Show list of all nodes at position clicked.")); + _update_ui(); + } break; + case NOTIFICATION_THEME_CHANGED: { suspend_button->set_button_icon(get_editor_theme_icon(SNAME("Pause"))); next_frame_button->set_button_icon(get_editor_theme_icon(SNAME("NextFrame"))); @@ -976,7 +981,6 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe suspend_button->set_toggle_mode(true); suspend_button->set_theme_type_variation(SceneStringName(FlatButton)); suspend_button->connect(SceneStringName(toggled), callable_mp(this, &GameView::_suspend_button_toggled)); - suspend_button->set_tooltip_text(TTR("Suspend")); suspend_button->set_accessibility_name(TTRC("Suspend")); ED_SHORTCUT("editor/suspend_resume_embedded_project", TTRC("Suspend/Resume Embedded Project"), Key::F9); ED_SHORTCUT_OVERRIDE("editor/suspend_resume_embedded_project", "macos", KeyModifierMask::META | KeyModifierMask::SHIFT | Key::B); @@ -986,7 +990,6 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe main_menu_hbox->add_child(next_frame_button); next_frame_button->set_theme_type_variation(SceneStringName(FlatButton)); next_frame_button->connect(SceneStringName(pressed), callable_mp(*debugger, &GameViewDebugger::next_frame)); - next_frame_button->set_tooltip_text(TTR("Next Frame")); next_frame_button->set_accessibility_name(TTRC("Next Frame")); next_frame_button->set_shortcut(ED_SHORTCUT("editor/next_frame_embedded_project", TTRC("Next Frame"), Key::F10)); @@ -994,28 +997,28 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE] = memnew(Button); main_menu_hbox->add_child(node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]); - node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_text(TTR("Input")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_text(TTRC("Input")); node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_toggle_mode(true); node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_pressed(true); node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_theme_type_variation(SceneStringName(FlatButton)); node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->connect(SceneStringName(pressed), callable_mp(this, &GameView::_node_type_pressed).bind(RuntimeNodeSelect::NODE_TYPE_NONE)); - node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_tooltip_text(TTR("Allow game input.")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_NONE]->set_tooltip_text(TTRC("Allow game input.")); node_type_button[RuntimeNodeSelect::NODE_TYPE_2D] = memnew(Button); main_menu_hbox->add_child(node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]); - node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_text(TTR("2D")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_text(TTRC("2D")); node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_toggle_mode(true); node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_theme_type_variation(SceneStringName(FlatButton)); node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->connect(SceneStringName(pressed), callable_mp(this, &GameView::_node_type_pressed).bind(RuntimeNodeSelect::NODE_TYPE_2D)); - node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_tooltip_text(TTR("Disable game input and allow to select Node2Ds, Controls, and manipulate the 2D camera.")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_2D]->set_tooltip_text(TTRC("Disable game input and allow to select Node2Ds, Controls, and manipulate the 2D camera.")); node_type_button[RuntimeNodeSelect::NODE_TYPE_3D] = memnew(Button); main_menu_hbox->add_child(node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]); - node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_text(TTR("3D")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_text(TTRC("3D")); node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_toggle_mode(true); node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_theme_type_variation(SceneStringName(FlatButton)); node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->connect(SceneStringName(pressed), callable_mp(this, &GameView::_node_type_pressed).bind(RuntimeNodeSelect::NODE_TYPE_3D)); - node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_tooltip_text(TTR("Disable game input and allow to select Node3Ds and manipulate the 3D camera.")); + node_type_button[RuntimeNodeSelect::NODE_TYPE_3D]->set_tooltip_text(TTRC("Disable game input and allow to select Node3Ds and manipulate the 3D camera.")); main_menu_hbox->add_child(memnew(VSeparator)); @@ -1024,7 +1027,7 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe hide_selection->set_toggle_mode(true); hide_selection->set_theme_type_variation(SceneStringName(FlatButton)); hide_selection->connect(SceneStringName(toggled), callable_mp(this, &GameView::_hide_selection_toggled)); - hide_selection->set_tooltip_text(TTR("Toggle Selection Visibility")); + hide_selection->set_tooltip_text(TTRC("Toggle Selection Visibility")); hide_selection->set_accessibility_name(TTRC("Selection Visibility")); hide_selection->set_pressed(EditorSettings::get_singleton()->get_project_metadata("game_view", "hide_selection", false)); @@ -1038,14 +1041,13 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->connect(SceneStringName(pressed), callable_mp(this, &GameView::_select_mode_pressed).bind(RuntimeNodeSelect::SELECT_MODE_SINGLE)); select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTRC("Select Mode"), Key::Q)); select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_shortcut_context(this); - select_mode_button[RuntimeNodeSelect::SELECT_MODE_SINGLE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+RMB: Show list of all nodes at position clicked.")); select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST] = memnew(Button); main_menu_hbox->add_child(select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]); select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_toggle_mode(true); select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_theme_type_variation(SceneStringName(FlatButton)); select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->connect(SceneStringName(pressed), callable_mp(this, &GameView::_select_mode_pressed).bind(RuntimeNodeSelect::SELECT_MODE_LIST)); - select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_tooltip_text(TTR("Show list of selectable nodes at position clicked.")); + select_mode_button[RuntimeNodeSelect::SELECT_MODE_LIST]->set_tooltip_text(TTRC("Show list of selectable nodes at position clicked.")); _select_mode_pressed(EditorSettings::get_singleton()->get_project_metadata("game_view", "select_mode", 0)); @@ -1063,7 +1065,7 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe main_menu_hbox->add_child(camera_override_button); camera_override_button->set_toggle_mode(true); camera_override_button->set_theme_type_variation(SceneStringName(FlatButton)); - camera_override_button->set_tooltip_text(TTR("Override the in-game camera.")); + camera_override_button->set_tooltip_text(TTRC("Override the in-game camera.")); camera_override_button->set_accessibility_name(TTRC("Override In-game Camera")); camera_override_button->connect(SceneStringName(toggled), callable_mp(this, &GameView::_camera_override_button_toggled)); @@ -1072,17 +1074,17 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe camera_override_menu->set_flat(false); camera_override_menu->set_theme_type_variation("FlatMenuButton"); camera_override_menu->set_h_size_flags(SIZE_SHRINK_END); - camera_override_menu->set_tooltip_text(TTR("Camera Override Options")); + camera_override_menu->set_tooltip_text(TTRC("Camera Override Options")); camera_override_menu->set_accessibility_name(TTRC("Camera Override Options")); PopupMenu *menu = camera_override_menu->get_popup(); menu->connect(SceneStringName(id_pressed), callable_mp(this, &GameView::_camera_override_menu_id_pressed)); - menu->add_item(TTR("Reset 2D Camera"), CAMERA_RESET_2D); - menu->add_item(TTR("Reset 3D Camera"), CAMERA_RESET_3D); + menu->add_item(TTRC("Reset 2D Camera"), CAMERA_RESET_2D); + menu->add_item(TTRC("Reset 3D Camera"), CAMERA_RESET_3D); menu->add_separator(); - menu->add_radio_check_item(TTR("Manipulate In-Game"), CAMERA_MODE_INGAME); + menu->add_radio_check_item(TTRC("Manipulate In-Game"), CAMERA_MODE_INGAME); menu->set_item_checked(menu->get_item_index(CAMERA_MODE_INGAME), true); - menu->add_radio_check_item(TTR("Manipulate From Editors"), CAMERA_MODE_EDITORS); + menu->add_radio_check_item(TTRC("Manipulate From Editors"), CAMERA_MODE_EDITORS); _camera_override_menu_id_pressed(EditorSettings::get_singleton()->get_project_metadata("game_view", "camera_override_mode", 0)); embedding_separator = memnew(VSeparator); @@ -1092,7 +1094,7 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe main_menu_hbox->add_child(fixed_size_button); fixed_size_button->set_toggle_mode(true); fixed_size_button->set_theme_type_variation("FlatButton"); - fixed_size_button->set_tooltip_text(TTR("Embedded game size is based on project settings.\nThe 'Keep Aspect' mode is used when the Game Workspace is smaller than the desired size.")); + fixed_size_button->set_tooltip_text(TTRC("Embedded game size is based on project settings.\nThe 'Keep Aspect' mode is used when the Game Workspace is smaller than the desired size.")); fixed_size_button->set_accessibility_name(TTRC("Fixed Size")); fixed_size_button->connect(SceneStringName(pressed), callable_mp(this, &GameView::_size_mode_button_pressed).bind(SIZE_MODE_FIXED)); @@ -1100,7 +1102,7 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe main_menu_hbox->add_child(keep_aspect_button); keep_aspect_button->set_toggle_mode(true); keep_aspect_button->set_theme_type_variation("FlatButton"); - keep_aspect_button->set_tooltip_text(TTR("Keep the aspect ratio of the embedded game.")); + keep_aspect_button->set_tooltip_text(TTRC("Keep the aspect ratio of the embedded game.")); keep_aspect_button->set_accessibility_name(TTRC("Keep Aspect Ratio")); keep_aspect_button->connect(SceneStringName(pressed), callable_mp(this, &GameView::_size_mode_button_pressed).bind(SIZE_MODE_KEEP_ASPECT)); @@ -1108,7 +1110,7 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe main_menu_hbox->add_child(stretch_button); stretch_button->set_toggle_mode(true); stretch_button->set_theme_type_variation("FlatButton"); - stretch_button->set_tooltip_text(TTR("Embedded game size stretches to fit the Game Workspace.")); + stretch_button->set_tooltip_text(TTRC("Embedded game size stretches to fit the Game Workspace.")); stretch_button->set_accessibility_name(TTRC("Stretch")); stretch_button->connect(SceneStringName(pressed), callable_mp(this, &GameView::_size_mode_button_pressed).bind(SIZE_MODE_STRETCH)); @@ -1117,13 +1119,13 @@ GameView::GameView(Ref p_debugger, EmbeddedProcessBase *p_embe embed_options_menu->set_flat(false); embed_options_menu->set_theme_type_variation("FlatMenuButton"); embed_options_menu->set_h_size_flags(SIZE_SHRINK_END); - embed_options_menu->set_tooltip_text(TTR("Embedding Options")); + embed_options_menu->set_tooltip_text(TTRC("Embedding Options")); embed_options_menu->set_accessibility_name(TTRC("Embedding Options")); menu = embed_options_menu->get_popup(); menu->connect(SceneStringName(id_pressed), callable_mp(this, &GameView::_embed_options_menu_menu_id_pressed)); - menu->add_check_item(TTR("Embed Game on Next Play"), EMBED_RUN_GAME_EMBEDDED); - menu->add_check_item(TTR("Make Game Workspace Floating on Next Play"), EMBED_MAKE_FLOATING_ON_PLAY); + menu->add_check_item(TTRC("Embed Game on Next Play"), EMBED_RUN_GAME_EMBEDDED); + menu->add_check_item(TTRC("Make Game Workspace Floating on Next Play"), EMBED_MAKE_FLOATING_ON_PLAY); main_menu_hbox->add_spacer(); @@ -1213,7 +1215,6 @@ void GameViewPluginBase::setup(Ref p_debugger, EmbeddedProcess debugger = p_debugger; window_wrapper = memnew(WindowWrapper); - window_wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), TTR("Game Workspace"))); window_wrapper->set_margins_enabled(true); game_view = memnew(GameView(debugger, p_embedded_process, window_wrapper)); @@ -1231,6 +1232,11 @@ void GameViewPluginBase::setup(Ref p_debugger, EmbeddedProcess void GameViewPluginBase::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { +#ifndef ANDROID_ENABLED + window_wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), TTR("Game Workspace"))); +#endif + } break; case NOTIFICATION_ENTER_TREE: { add_debugger_plugin(debugger); connect("main_screen_changed", callable_mp(this, &GameViewPluginBase::_save_last_editor)); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 806968b3eed..96a8c26e12f 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -692,7 +692,7 @@ void Node3DEditorViewport::cancel_transform() { collision_reposition = false; finish_transform(); - set_message(TTR("Transform Aborted."), 3); + set_message(TTRC("Transform Aborted."), 3); } void Node3DEditorViewport::_update_shrink() { @@ -2929,6 +2929,51 @@ static void override_button_stylebox(Button *p_button, const Ref p_sty void Node3DEditorViewport::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + _update_name(); + message_time = MIN(message_time, 0.001); // Make it disappear. + + Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; + preview_material_label_desc->set_text(vformat(TTR("Drag and drop to override the material of any geometry node.\nHold %s when dropping to override a specific surface."), find_keycode_name(key))); + + const int item_count = display_submenu->get_item_count(); + for (int i = 0; i < item_count; i++) { + const Array item_data = display_submenu->get_item_metadata(i); + if (item_data.is_empty()) { + continue; + } + + SupportedRenderingMethods rendering_methods = item_data[0]; + String base_tooltip = item_data[1]; + + bool disabled = false; + String disabled_tooltip; + switch (rendering_methods) { + case SupportedRenderingMethods::ALL: + break; + case SupportedRenderingMethods::FORWARD_PLUS_MOBILE: + disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility"; + disabled_tooltip = TTR("This debug draw mode is not supported when using the Compatibility rendering method."); + break; + case SupportedRenderingMethods::FORWARD_PLUS: + disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" || OS::get_singleton()->get_current_rendering_method() == "mobile"; + disabled_tooltip = TTR("This debug draw mode is not supported when using the Mobile or Compatibility rendering methods."); + break; + } + + display_submenu->set_item_disabled(i, disabled); + String tooltip = TTR(base_tooltip); + if (disabled) { + if (tooltip.is_empty()) { + tooltip = disabled_tooltip; + } else { + tooltip += "\n\n" + disabled_tooltip; + } + } + display_submenu->set_item_tooltip(i, tooltip); + } + } break; + case NOTIFICATION_READY: { ProjectSettings::get_singleton()->connect("settings_changed", callable_mp(this, &Node3DEditorViewport::_project_settings_changed)); } break; @@ -3577,7 +3622,6 @@ void Node3DEditorViewport::_menu_option(int p_option) { const List &selection = editor_selection->get_top_selected_node_list(); undo_redo->create_action(TTR("Align Transform with View")); - for (Node *E : selection) { Node3D *sp = Object::cast_to(E); if (!sp) { @@ -5514,32 +5558,8 @@ void Node3DEditorViewport::_set_lock_view_rotation(bool p_lock_rotation) { void Node3DEditorViewport::_add_advanced_debug_draw_mode_item(PopupMenu *p_popup, const String &p_name, int p_value, SupportedRenderingMethods p_rendering_methods, const String &p_tooltip) { display_submenu->add_radio_check_item(p_name, p_value); - - bool disabled = false; - String disabled_tooltip; - switch (p_rendering_methods) { - case SupportedRenderingMethods::ALL: - break; - case SupportedRenderingMethods::FORWARD_PLUS_MOBILE: - disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility"; - disabled_tooltip = TTR("This debug draw mode is not supported when using the Compatibility rendering method."); - break; - case SupportedRenderingMethods::FORWARD_PLUS: - disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" || OS::get_singleton()->get_current_rendering_method() == "mobile"; - disabled_tooltip = TTR("This debug draw mode is not supported when using the Mobile or Compatibility rendering methods."); - break; - } - - display_submenu->set_item_disabled(-1, disabled); - String tooltip = p_tooltip; - if (disabled) { - if (tooltip.is_empty()) { - tooltip = disabled_tooltip; - } else { - tooltip += "\n\n" + disabled_tooltip; - } - } - display_submenu->set_item_tooltip(-1, tooltip); + Array item_data = { p_rendering_methods, p_tooltip }; + display_submenu->set_item_metadata(-1, item_data); // Tooltip is assigned in NOTIFICATION_TRANSLATION_CHANGED. } Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p_index) { @@ -5598,6 +5618,8 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p view_display_menu->set_h_size_flags(0); view_display_menu->set_shortcut_context(this); view_display_menu->set_accessibility_name(TTRC("View")); + view_display_menu->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); + view_display_menu->get_popup()->set_auto_translate_mode(AUTO_TRANSLATE_MODE_ALWAYS); hbox->add_child(view_display_menu); view_display_menu->get_popup()->set_hide_on_checkable_item_selection(false); @@ -5610,10 +5632,10 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p view_display_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/rear_view"), VIEW_REAR); view_display_menu->get_popup()->add_separator(); view_display_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/switch_perspective_orthogonal"), VIEW_SWITCH_PERSPECTIVE_ORTHOGONAL); - view_display_menu->get_popup()->add_radio_check_item(TTR("Perspective"), VIEW_PERSPECTIVE); - view_display_menu->get_popup()->add_radio_check_item(TTR("Orthogonal"), VIEW_ORTHOGONAL); + view_display_menu->get_popup()->add_radio_check_item(TTRC("Perspective"), VIEW_PERSPECTIVE); + view_display_menu->get_popup()->add_radio_check_item(TTRC("Orthogonal"), VIEW_ORTHOGONAL); view_display_menu->get_popup()->set_item_checked(view_display_menu->get_popup()->get_item_index(VIEW_PERSPECTIVE), true); - view_display_menu->get_popup()->add_check_item(TTR("Auto Orthogonal Enabled"), VIEW_AUTO_ORTHOGONAL); + view_display_menu->get_popup()->add_check_item(TTRC("Auto Orthogonal Enabled"), VIEW_AUTO_ORTHOGONAL); view_display_menu->get_popup()->set_item_checked(view_display_menu->get_popup()->get_item_index(VIEW_AUTO_ORTHOGONAL), true); view_display_menu->get_popup()->add_separator(); view_display_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_lock_rotation", TTRC("Lock View Rotation")), VIEW_LOCK_ROTATION); @@ -5628,60 +5650,60 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p display_submenu = memnew(PopupMenu); display_submenu->set_hide_on_checkable_item_selection(false); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, - TTR("Displays directional shadow splits in different colors to make adjusting split thresholds easier. \nRed: 1st split (closest to the camera), Green: 2nd split, Blue: 3rd split, Yellow: 4th split (furthest from the camera)")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, + TTRC("Displays directional shadow splits in different colors to make adjusting split thresholds easier. \nRed: 1st split (closest to the camera), Green: 2nd split, Blue: 3rd split, Yellow: 4th split (furthest from the camera)")); display_submenu->add_separator(); // TRANSLATORS: "Normal" as in "normal vector", not "normal life". - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER, SupportedRenderingMethods::FORWARD_PLUS); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER, SupportedRenderingMethods::FORWARD_PLUS); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Shadow Atlas"), VIEW_DISPLAY_DEBUG_SHADOW_ATLAS, SupportedRenderingMethods::ALL, - TTR("Displays the shadow atlas used for positional (omni/spot) shadow mapping.\nRequires a visible OmniLight3D or SpotLight3D node with shadows enabled to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Directional Shadow Map"), VIEW_DISPLAY_DEBUG_DIRECTIONAL_SHADOW_ATLAS, SupportedRenderingMethods::ALL, - TTR("Displays the shadow map used for directional shadow mapping.\nRequires a visible DirectionalLight3D node with shadows enabled to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Shadow Atlas"), VIEW_DISPLAY_DEBUG_SHADOW_ATLAS, SupportedRenderingMethods::ALL, + TTRC("Displays the shadow atlas used for positional (omni/spot) shadow mapping.\nRequires a visible OmniLight3D or SpotLight3D node with shadows enabled to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Directional Shadow Map"), VIEW_DISPLAY_DEBUG_DIRECTIONAL_SHADOW_ATLAS, SupportedRenderingMethods::ALL, + TTRC("Displays the shadow map used for directional shadow mapping.\nRequires a visible DirectionalLight3D node with shadows enabled to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Decal Atlas"), VIEW_DISPLAY_DEBUG_DECAL_ATLAS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Decal Atlas"), VIEW_DISPLAY_DEBUG_DECAL_ATLAS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("VoxelGI Lighting"), VIEW_DISPLAY_DEBUG_VOXEL_GI_LIGHTING, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires a visible VoxelGI node that has been baked to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("VoxelGI Albedo"), VIEW_DISPLAY_DEBUG_VOXEL_GI_ALBEDO, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires a visible VoxelGI node that has been baked to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("VoxelGI Emission"), VIEW_DISPLAY_DEBUG_VOXEL_GI_EMISSION, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires a visible VoxelGI node that has been baked to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("VoxelGI Lighting"), VIEW_DISPLAY_DEBUG_VOXEL_GI_LIGHTING, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires a visible VoxelGI node that has been baked to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("VoxelGI Albedo"), VIEW_DISPLAY_DEBUG_VOXEL_GI_ALBEDO, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires a visible VoxelGI node that has been baked to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("VoxelGI Emission"), VIEW_DISPLAY_DEBUG_VOXEL_GI_EMISSION, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires a visible VoxelGI node that has been baked to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("SDFGI Cascades"), VIEW_DISPLAY_DEBUG_SDFGI, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires SDFGI to be enabled in Environment to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("SDFGI Probes"), VIEW_DISPLAY_DEBUG_SDFGI_PROBES, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires SDFGI to be enabled in Environment to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("SDFGI Cascades"), VIEW_DISPLAY_DEBUG_SDFGI, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires SDFGI to be enabled in Environment to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("SDFGI Probes"), VIEW_DISPLAY_DEBUG_SDFGI_PROBES, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires SDFGI to be enabled in Environment to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Scene Luminance"), VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, - TTR("Displays the scene luminance computed from the 3D buffer. This is used for Auto Exposure calculation.\nRequires Auto Exposure to be enabled in CameraAttributes to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Scene Luminance"), VIEW_DISPLAY_DEBUG_SCENE_LUMINANCE, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, + TTRC("Displays the scene luminance computed from the 3D buffer. This is used for Auto Exposure calculation.\nRequires Auto Exposure to be enabled in CameraAttributes to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("SSAO"), VIEW_DISPLAY_DEBUG_SSAO, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Displays the screen-space ambient occlusion buffer. Requires SSAO to be enabled in Environment to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("SSIL"), VIEW_DISPLAY_DEBUG_SSIL, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Displays the screen-space indirect lighting buffer. Requires SSIL to be enabled in Environment to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("SSAO"), VIEW_DISPLAY_DEBUG_SSAO, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Displays the screen-space ambient occlusion buffer. Requires SSAO to be enabled in Environment to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("SSIL"), VIEW_DISPLAY_DEBUG_SSIL, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Displays the screen-space indirect lighting buffer. Requires SSIL to be enabled in Environment to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("VoxelGI/SDFGI Buffer"), VIEW_DISPLAY_DEBUG_GI_BUFFER, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Requires SDFGI or VoxelGI to be enabled to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("VoxelGI/SDFGI Buffer"), VIEW_DISPLAY_DEBUG_GI_BUFFER, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Requires SDFGI or VoxelGI to be enabled to have a visible effect.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Disable Mesh LOD"), VIEW_DISPLAY_DEBUG_DISABLE_LOD, SupportedRenderingMethods::ALL, - TTR("Renders all meshes with their highest level of detail regardless of their distance from the camera.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Disable Mesh LOD"), VIEW_DISPLAY_DEBUG_DISABLE_LOD, SupportedRenderingMethods::ALL, + TTRC("Renders all meshes with their highest level of detail regardless of their distance from the camera.")); display_submenu->add_separator(); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("OmniLight3D Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_OMNI_LIGHTS, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Highlights tiles of pixels that are affected by at least one OmniLight3D.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("SpotLight3D Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_SPOT_LIGHTS, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Highlights tiles of pixels that are affected by at least one SpotLight3D.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Decal Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_DECALS, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Highlights tiles of pixels that are affected by at least one Decal.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("ReflectionProbe Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_REFLECTION_PROBES, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Highlights tiles of pixels that are affected by at least one ReflectionProbe.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Occlusion Culling Buffer"), VIEW_DISPLAY_DEBUG_OCCLUDERS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, - TTR("Represents occluders with black pixels. Requires occlusion culling to be enabled to have a visible effect.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Motion Vectors"), VIEW_DISPLAY_MOTION_VECTORS, SupportedRenderingMethods::FORWARD_PLUS, - TTR("Represents motion vectors with colored lines in the direction of motion. Gray dots represent areas with no per-pixel motion.")); - _add_advanced_debug_draw_mode_item(display_submenu, TTR("Internal Buffer"), VIEW_DISPLAY_INTERNAL_BUFFER, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, - TTR("Shows the scene rendered in linear colorspace before any tonemapping or post-processing.")); - view_display_menu->get_popup()->add_submenu_node_item(TTR("Display Advanced..."), display_submenu, VIEW_DISPLAY_ADVANCED); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("OmniLight3D Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_OMNI_LIGHTS, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Highlights tiles of pixels that are affected by at least one OmniLight3D.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("SpotLight3D Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_SPOT_LIGHTS, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Highlights tiles of pixels that are affected by at least one SpotLight3D.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Decal Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_DECALS, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Highlights tiles of pixels that are affected by at least one Decal.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("ReflectionProbe Cluster"), VIEW_DISPLAY_DEBUG_CLUSTER_REFLECTION_PROBES, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Highlights tiles of pixels that are affected by at least one ReflectionProbe.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Occlusion Culling Buffer"), VIEW_DISPLAY_DEBUG_OCCLUDERS, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, + TTRC("Represents occluders with black pixels. Requires occlusion culling to be enabled to have a visible effect.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Motion Vectors"), VIEW_DISPLAY_MOTION_VECTORS, SupportedRenderingMethods::FORWARD_PLUS, + TTRC("Represents motion vectors with colored lines in the direction of motion. Gray dots represent areas with no per-pixel motion.")); + _add_advanced_debug_draw_mode_item(display_submenu, TTRC("Internal Buffer"), VIEW_DISPLAY_INTERNAL_BUFFER, SupportedRenderingMethods::FORWARD_PLUS_MOBILE, + TTRC("Shows the scene rendered in linear colorspace before any tonemapping or post-processing.")); + view_display_menu->get_popup()->add_submenu_node_item(TTRC("Display Advanced..."), display_submenu, VIEW_DISPLAY_ADVANCED); view_display_menu->get_popup()->add_separator(); view_display_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTRC("View Environment")), VIEW_ENVIRONMENT); @@ -5745,7 +5767,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p hbox->add_child(translation_preview_button); preview_camera = memnew(CheckBox); - preview_camera->set_text(TTR("Preview")); + preview_camera->set_text(TTRC("Preview")); // Using Control even on macOS to avoid conflict with Quick Open shortcut. preview_camera->set_shortcut(ED_SHORTCUT("spatial_editor/toggle_camera_preview", TTRC("Toggle Camera Preview"), KeyModifierMask::CTRL | Key::P)); vbox->add_child(preview_camera); @@ -5786,7 +5808,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p cinema_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); cinema_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); surface->add_child(cinema_label); - cinema_label->set_text(TTR("Cinematic Preview")); + cinema_label->set_text(TTRC("Cinematic Preview")); cinema_label->hide(); previewing_cinema = false; @@ -5795,11 +5817,11 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p locked_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); locked_label->set_h_size_flags(SIZE_SHRINK_CENTER); bottom_center_vbox->add_child(locked_label); - locked_label->set_text(TTR("View Rotation Locked")); + locked_label->set_text(TTRC("View Rotation Locked")); locked_label->hide(); zoom_limit_label = memnew(Label); - zoom_limit_label->set_text(TTR("To zoom further, change the camera's clipping planes (View -> Settings...)")); + zoom_limit_label->set_text(TTRC("To zoom further, change the camera's clipping planes (View -> Settings...)")); zoom_limit_label->set_name("ZoomLimitMessageLabel"); zoom_limit_label->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1)); zoom_limit_label->hide(); @@ -5808,7 +5830,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p preview_material_label = memnew(Label); preview_material_label->set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_LEFT); preview_material_label->set_offset(Side::SIDE_TOP, -70 * EDSCALE); - preview_material_label->set_text(TTR("Overriding material...")); + preview_material_label->set_text(TTRC("Overriding material...")); preview_material_label->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1)); preview_material_label->hide(); surface->add_child(preview_material_label); @@ -5817,8 +5839,6 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p preview_material_label_desc->set_focus_mode(FOCUS_ACCESSIBILITY); preview_material_label_desc->set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_LEFT); preview_material_label_desc->set_offset(Side::SIDE_TOP, -50 * EDSCALE); - Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL; - preview_material_label_desc->set_text(vformat(TTR("Drag and drop to override the material of any geometry node.\nHold %s when dropping to override a specific surface."), find_keycode_name(key))); preview_material_label_desc->add_theme_color_override(SceneStringName(font_color), Color(0.8, 0.8, 0.8, 1)); preview_material_label_desc->add_theme_constant_override("line_spacing", 0); preview_material_label_desc->hide(); @@ -8303,6 +8323,14 @@ void Node3DEditor::_update_theme() { void Node3DEditor::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)")); + tool_button[TOOL_MODE_MOVE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); + tool_button[TOOL_MODE_ROTATE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); + tool_button[TOOL_MODE_SCALE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); + _update_gizmos_menu(); + } break; + case NOTIFICATION_READY: { _menu_item_pressed(MENU_VIEW_USE_1_VIEWPORT); @@ -8333,7 +8361,6 @@ void Node3DEditor::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { _update_theme(); _register_all_gizmos(); - _update_gizmos_menu(); _init_indicators(); update_all_gizmos(); } break; @@ -8874,9 +8901,9 @@ void Node3DEditor::_update_preview_environment() { } if (directional_light_count > 0) { - sun_state->set_text(TTR("Scene contains\nDirectionalLight3D.\nPreview disabled.")); + sun_state->set_text(TTRC("Scene contains\nDirectionalLight3D.\nPreview disabled.")); } else { - sun_state->set_text(TTR("Preview disabled.")); + sun_state->set_text(TTRC("Preview disabled.")); } } else { @@ -8903,9 +8930,9 @@ void Node3DEditor::_update_preview_environment() { preview_env_dangling = true; } if (world_env_count > 0) { - environ_state->set_text(TTR("Scene contains\nWorldEnvironment.\nPreview disabled.")); + environ_state->set_text(TTRC("Scene contains\nWorldEnvironment.\nPreview disabled.")); } else { - environ_state->set_text(TTR("Preview disabled.")); + environ_state->set_text(TTRC("Preview disabled.")); } } else { @@ -9116,44 +9143,44 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_MODE_SELECT] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_MODE_SELECT]); tool_button[TOOL_MODE_SELECT]->set_toggle_mode(true); + tool_button[TOOL_MODE_SELECT]->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); tool_button[TOOL_MODE_SELECT]->set_theme_type_variation(SceneStringName(FlatButton)); tool_button[TOOL_MODE_SELECT]->set_pressed(true); tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT)); tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTRC("Select Mode"), Key::Q, true)); tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this); - tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)")); tool_button[TOOL_MODE_SELECT]->set_accessibility_name(TTRC("Select Mode")); main_menu_hbox->add_child(memnew(VSeparator)); tool_button[TOOL_MODE_MOVE] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_MODE_MOVE]); tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true); + tool_button[TOOL_MODE_MOVE]->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); tool_button[TOOL_MODE_MOVE]->set_theme_type_variation(SceneStringName(FlatButton)); tool_button[TOOL_MODE_MOVE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_MOVE)); tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTRC("Move Mode"), Key::W, true)); tool_button[TOOL_MODE_MOVE]->set_shortcut_context(this); - tool_button[TOOL_MODE_MOVE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); tool_button[TOOL_MODE_MOVE]->set_accessibility_name(TTRC("Move Mode")); tool_button[TOOL_MODE_ROTATE] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_MODE_ROTATE]); tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true); + tool_button[TOOL_MODE_ROTATE]->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); tool_button[TOOL_MODE_ROTATE]->set_theme_type_variation(SceneStringName(FlatButton)); tool_button[TOOL_MODE_ROTATE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_ROTATE)); tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTRC("Rotate Mode"), Key::E, true)); tool_button[TOOL_MODE_ROTATE]->set_shortcut_context(this); - tool_button[TOOL_MODE_ROTATE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); tool_button[TOOL_MODE_ROTATE]->set_accessibility_name(TTRC("Rotate Mode")); tool_button[TOOL_MODE_SCALE] = memnew(Button); main_menu_hbox->add_child(tool_button[TOOL_MODE_SCALE]); tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true); + tool_button[TOOL_MODE_SCALE]->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); tool_button[TOOL_MODE_SCALE]->set_theme_type_variation(SceneStringName(FlatButton)); tool_button[TOOL_MODE_SCALE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE)); tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTRC("Scale Mode"), Key::R, true)); tool_button[TOOL_MODE_SCALE]->set_shortcut_context(this); - tool_button[TOOL_MODE_SCALE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.")); tool_button[TOOL_MODE_SCALE]->set_accessibility_name(TTRC("Scale Mode")); main_menu_hbox->add_child(memnew(VSeparator)); @@ -9163,7 +9190,7 @@ Node3DEditor::Node3DEditor() { tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true); tool_button[TOOL_MODE_LIST_SELECT]->set_theme_type_variation(SceneStringName(FlatButton)); tool_button[TOOL_MODE_LIST_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_LIST_SELECT)); - tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip_text(TTR("Show list of selectable nodes at position clicked.")); + tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip_text(TTRC("Show list of selectable nodes at position clicked.")); tool_button[TOOL_MODE_LIST_SELECT]->set_accessibility_name(TTRC("Show List of Selectable Nodes")); tool_button[TOOL_LOCK_SELECTED] = memnew(Button); @@ -9234,7 +9261,7 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(memnew(VSeparator)); sun_button = memnew(Button); - sun_button->set_tooltip_text(TTR("Toggle preview sunlight.\nIf a DirectionalLight3D node is added to the scene, preview sunlight is disabled.")); + sun_button->set_tooltip_text(TTRC("Toggle preview sunlight.\nIf a DirectionalLight3D node is added to the scene, preview sunlight is disabled.")); sun_button->set_toggle_mode(true); sun_button->set_accessibility_name(TTRC("Preview Sunlight")); sun_button->set_theme_type_variation(SceneStringName(FlatButton)); @@ -9245,7 +9272,7 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(sun_button); environ_button = memnew(Button); - environ_button->set_tooltip_text(TTR("Toggle preview environment.\nIf a WorldEnvironment node is added to the scene, preview environment is disabled.")); + environ_button->set_tooltip_text(TTRC("Toggle preview environment.\nIf a WorldEnvironment node is added to the scene, preview environment is disabled.")); environ_button->set_toggle_mode(true); environ_button->set_accessibility_name(TTRC("Preview Environment")); environ_button->set_theme_type_variation(SceneStringName(FlatButton)); @@ -9256,7 +9283,7 @@ Node3DEditor::Node3DEditor() { main_menu_hbox->add_child(environ_button); sun_environ_settings = memnew(Button); - sun_environ_settings->set_tooltip_text(TTR("Edit Sun and Environment settings.")); + sun_environ_settings->set_tooltip_text(TTRC("Edit Sun and Environment settings.")); sun_environ_settings->set_theme_type_variation(SceneStringName(FlatButton)); sun_environ_settings->set_accessibility_name(TTRC("Edit Sun and Environment")); sun_environ_settings->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_sun_environ_settings_pressed)); @@ -9302,7 +9329,7 @@ Node3DEditor::Node3DEditor() { transform_menu = memnew(MenuButton); transform_menu->set_flat(false); transform_menu->set_theme_type_variation("FlatMenuButton"); - transform_menu->set_text(TTR("Transform")); + transform_menu->set_text(TTRC("Transform")); transform_menu->set_switch_on_hover(true); transform_menu->set_shortcut_context(this); main_menu_hbox->add_child(transform_menu); @@ -9320,7 +9347,7 @@ Node3DEditor::Node3DEditor() { view_layout_menu->set_flat(false); view_layout_menu->set_theme_type_variation("FlatMenuButton"); // TRANSLATORS: Noun, name of the 2D/3D View menus. - view_layout_menu->set_text(TTR("View")); + view_layout_menu->set_text(TTRC("View")); view_layout_menu->set_switch_on_hover(true); view_layout_menu->set_shortcut_context(this); main_menu_hbox->add_child(view_layout_menu); @@ -9348,8 +9375,9 @@ Node3DEditor::Node3DEditor() { p->add_separator(); gizmos_menu = memnew(PopupMenu); + gizmos_menu->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); gizmos_menu->set_hide_on_checkable_item_selection(false); - p->add_submenu_node_item(TTR("Gizmos"), gizmos_menu); + p->add_submenu_node_item(TTRC("Gizmos"), gizmos_menu); gizmos_menu->connect(SceneStringName(id_pressed), callable_mp(this, &Node3DEditor::_menu_gizmo_toggled)); p->add_separator(); @@ -9394,7 +9422,7 @@ Node3DEditor::Node3DEditor() { /* SNAP DIALOG */ snap_dialog = memnew(ConfirmationDialog); - snap_dialog->set_title(TTR("Snap Settings")); + snap_dialog->set_title(TTRC("Snap Settings")); add_child(snap_dialog); snap_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Node3DEditor::_snap_changed)); snap_dialog->get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_snap_update)); @@ -9405,22 +9433,22 @@ Node3DEditor::Node3DEditor() { snap_translate = memnew(LineEdit); snap_translate->set_select_all_on_focus(true); snap_translate->set_accessibility_name(TTRC("Translate Snap")); - snap_dialog_vbc->add_margin_child(TTR("Translate Snap:"), snap_translate); + snap_dialog_vbc->add_margin_child(TTRC("Translate Snap:"), snap_translate); snap_rotate = memnew(LineEdit); snap_rotate->set_select_all_on_focus(true); snap_rotate->set_accessibility_name(TTRC("Rotate Snap")); - snap_dialog_vbc->add_margin_child(TTR("Rotate Snap (deg.):"), snap_rotate); + snap_dialog_vbc->add_margin_child(TTRC("Rotate Snap (deg.):"), snap_rotate); snap_scale = memnew(LineEdit); snap_scale->set_select_all_on_focus(true); snap_scale->set_accessibility_name(TTRC("Scale Snap")); - snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"), snap_scale); + snap_dialog_vbc->add_margin_child(TTRC("Scale Snap (%):"), snap_scale); /* SETTINGS DIALOG */ settings_dialog = memnew(ConfirmationDialog); - settings_dialog->set_title(TTR("Viewport Settings")); + settings_dialog->set_title(TTRC("Viewport Settings")); add_child(settings_dialog); settings_vbc = memnew(VBoxContainer); settings_vbc->set_custom_minimum_size(Size2(200, 0) * EDSCALE); @@ -9432,9 +9460,9 @@ Node3DEditor::Node3DEditor() { settings_fov->set_step(0.1); settings_fov->set_value(EDITOR_GET("editors/3d/default_fov")); settings_fov->set_select_all_on_focus(true); - settings_fov->set_tooltip_text(TTR("FOV is defined as a vertical value, as the editor camera always uses the Keep Height aspect mode.")); + settings_fov->set_tooltip_text(TTRC("FOV is defined as a vertical value, as the editor camera always uses the Keep Height aspect mode.")); settings_fov->set_accessibility_name(TTRC("Perspective VFOV")); - settings_vbc->add_margin_child(TTR("Perspective VFOV (deg.):"), settings_fov); + settings_vbc->add_margin_child(TTRC("Perspective VFOV (deg.):"), settings_fov); settings_znear = memnew(SpinBox); settings_znear->set_max(MAX_Z); @@ -9443,7 +9471,7 @@ Node3DEditor::Node3DEditor() { settings_znear->set_accessibility_name(TTRC("View Z-Near")); settings_znear->set_value(EDITOR_GET("editors/3d/default_z_near")); settings_znear->set_select_all_on_focus(true); - settings_vbc->add_margin_child(TTR("View Z-Near:"), settings_znear); + settings_vbc->add_margin_child(TTRC("View Z-Near:"), settings_znear); settings_zfar = memnew(SpinBox); settings_zfar->set_max(MAX_Z); @@ -9452,7 +9480,7 @@ Node3DEditor::Node3DEditor() { settings_zfar->set_accessibility_name(TTRC("View Z-Far")); settings_zfar->set_value(EDITOR_GET("editors/3d/default_z_far")); settings_zfar->set_select_all_on_focus(true); - settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar); + settings_vbc->add_margin_child(TTRC("View Z-Far:"), settings_zfar); for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) { settings_dialog->connect(SceneStringName(confirmed), callable_mp(viewports[i], &Node3DEditorViewport::_view_settings_confirmed).bind(0.0)); @@ -9461,14 +9489,14 @@ Node3DEditor::Node3DEditor() { /* XFORM DIALOG */ xform_dialog = memnew(ConfirmationDialog); - xform_dialog->set_title(TTR("Transform Change")); + xform_dialog->set_title(TTRC("Transform Change")); add_child(xform_dialog); VBoxContainer *xform_vbc = memnew(VBoxContainer); xform_dialog->add_child(xform_vbc); Label *l = memnew(Label); - l->set_text(TTR("Translate:")); + l->set_text(TTRC("Translate:")); xform_vbc->add_child(l); HBoxContainer *xform_hbc = memnew(HBoxContainer); @@ -9482,7 +9510,7 @@ Node3DEditor::Node3DEditor() { } l = memnew(Label); - l->set_text(TTR("Rotate (deg.):")); + l->set_text(TTRC("Rotate (deg.):")); xform_vbc->add_child(l); xform_hbc = memnew(HBoxContainer); @@ -9496,7 +9524,7 @@ Node3DEditor::Node3DEditor() { } l = memnew(Label); - l->set_text(TTR("Scale (ratio):")); + l->set_text(TTRC("Scale (ratio):")); xform_vbc->add_child(l); xform_hbc = memnew(HBoxContainer); @@ -9510,14 +9538,14 @@ Node3DEditor::Node3DEditor() { } l = memnew(Label); - l->set_text(TTR("Transform Type")); + l->set_text(TTRC("Transform Type")); xform_vbc->add_child(l); xform_type = memnew(OptionButton); xform_type->set_h_size_flags(SIZE_EXPAND_FILL); xform_type->set_accessibility_name(TTRC("Transform Type")); - xform_type->add_item(TTR("Pre")); - xform_type->add_item(TTR("Post")); + xform_type->add_item(TTRC("Pre")); + xform_type->add_item(TTRC("Post")); xform_vbc->add_child(xform_type); xform_dialog->connect(SceneStringName(confirmed), callable_mp(this, &Node3DEditor::_xform_dialog_action)); @@ -9546,14 +9574,14 @@ Node3DEditor::Node3DEditor() { sun_title = memnew(Label); sun_title->set_theme_type_variation("HeaderMedium"); sun_vb->add_child(sun_title); - sun_title->set_text(TTR("Preview Sun")); + sun_title->set_text(TTRC("Preview Sun")); sun_title->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); CenterContainer *sun_direction_center = memnew(CenterContainer); sun_direction = memnew(Control); sun_direction->set_custom_minimum_size(Size2(128, 128) * EDSCALE); sun_direction_center->add_child(sun_direction); - sun_vb->add_margin_child(TTR("Sun Direction"), sun_direction_center); + sun_vb->add_margin_child(TTRC("Sun Direction"), sun_direction_center); sun_direction->connect(SceneStringName(gui_input), callable_mp(this, &Node3DEditor::_sun_direction_input)); sun_direction->connect(SceneStringName(draw), callable_mp(this, &Node3DEditor::_sun_direction_draw)); sun_direction->set_default_cursor_shape(CURSOR_MOVE); @@ -9586,7 +9614,7 @@ void fragment() { VBoxContainer *sun_angle_altitude_vbox = memnew(VBoxContainer); sun_angle_altitude_vbox->set_h_size_flags(SIZE_EXPAND_FILL); Label *sun_angle_altitude_label = memnew(Label); - sun_angle_altitude_label->set_text(TTR("Angular Altitude")); + sun_angle_altitude_label->set_text(TTRC("Angular Altitude")); sun_angle_altitude_vbox->add_child(sun_angle_altitude_label); sun_angle_altitude = memnew(EditorSpinSlider); sun_angle_altitude->set_suffix(U"\u00B0"); @@ -9600,7 +9628,7 @@ void fragment() { sun_angle_azimuth_vbox->set_h_size_flags(SIZE_EXPAND_FILL); sun_angle_azimuth_vbox->set_custom_minimum_size(Vector2(100, 0)); Label *sun_angle_azimuth_label = memnew(Label); - sun_angle_azimuth_label->set_text(TTR("Azimuth")); + sun_angle_azimuth_label->set_text(TTRC("Azimuth")); sun_angle_azimuth_vbox->add_child(sun_angle_azimuth_label); sun_angle_azimuth = memnew(EditorSpinSlider); sun_angle_azimuth->set_suffix(U"\u00B0"); @@ -9617,7 +9645,7 @@ void fragment() { sun_color = memnew(ColorPickerButton); sun_color->set_edit_alpha(false); - sun_vb->add_margin_child(TTR("Sun Color"), sun_color); + sun_vb->add_margin_child(TTRC("Sun Color"), sun_color); sun_color->connect("color_changed", callable_mp(this, &Node3DEditor::_sun_set_color)); sun_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(sun_color->get_picker())); @@ -9625,18 +9653,18 @@ void fragment() { sun_energy->set_max(64.0); sun_energy->set_min(0); sun_energy->set_step(0.05); - sun_vb->add_margin_child(TTR("Sun Energy"), sun_energy); + sun_vb->add_margin_child(TTRC("Sun Energy"), sun_energy); sun_energy->connect(SceneStringName(value_changed), callable_mp(this, &Node3DEditor::_sun_set_energy)); sun_shadow_max_distance = memnew(EditorSpinSlider); - sun_vb->add_margin_child(TTR("Shadow Max Distance"), sun_shadow_max_distance); + sun_vb->add_margin_child(TTRC("Shadow Max Distance"), sun_shadow_max_distance); sun_shadow_max_distance->connect(SceneStringName(value_changed), callable_mp(this, &Node3DEditor::_sun_set_shadow_max_distance)); sun_shadow_max_distance->set_min(1); sun_shadow_max_distance->set_max(4096); sun_add_to_scene = memnew(Button); - sun_add_to_scene->set_text(TTR("Add Sun to Scene")); - sun_add_to_scene->set_tooltip_text(TTR("Adds a DirectionalLight3D node matching the preview sun settings to the current scene.\nHold Shift while clicking to also add the preview environment to the current scene.")); + sun_add_to_scene->set_text(TTRC("Add Sun to Scene")); + sun_add_to_scene->set_tooltip_text(TTRC("Adds a DirectionalLight3D node matching the preview sun settings to the current scene.\nHold Shift while clicking to also add the preview environment to the current scene.")); sun_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_sun_to_scene).bind(false)); sun_vb->add_spacer(); sun_vb->add_child(sun_add_to_scene); @@ -9661,57 +9689,57 @@ void fragment() { environ_title->set_theme_type_variation("HeaderMedium"); environ_vb->add_child(environ_title); - environ_title->set_text(TTR("Preview Environment")); + environ_title->set_text(TTRC("Preview Environment")); environ_title->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); environ_sky_color = memnew(ColorPickerButton); environ_sky_color->set_edit_alpha(false); environ_sky_color->connect("color_changed", callable_mp(this, &Node3DEditor::_environ_set_sky_color)); environ_sky_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(environ_sky_color->get_picker())); - environ_vb->add_margin_child(TTR("Sky Color"), environ_sky_color); + environ_vb->add_margin_child(TTRC("Sky Color"), environ_sky_color); environ_ground_color = memnew(ColorPickerButton); environ_ground_color->connect("color_changed", callable_mp(this, &Node3DEditor::_environ_set_ground_color)); environ_ground_color->set_edit_alpha(false); environ_ground_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(environ_ground_color->get_picker())); - environ_vb->add_margin_child(TTR("Ground Color"), environ_ground_color); + environ_vb->add_margin_child(TTRC("Ground Color"), environ_ground_color); environ_energy = memnew(EditorSpinSlider); environ_energy->set_max(8.0); environ_energy->set_min(0); environ_energy->set_step(0.05); environ_energy->connect(SceneStringName(value_changed), callable_mp(this, &Node3DEditor::_environ_set_sky_energy)); - environ_vb->add_margin_child(TTR("Sky Energy"), environ_energy); + environ_vb->add_margin_child(TTRC("Sky Energy"), environ_energy); HBoxContainer *fx_vb = memnew(HBoxContainer); fx_vb->set_h_size_flags(SIZE_EXPAND_FILL); environ_ao_button = memnew(Button); - environ_ao_button->set_text(TTR("AO")); + environ_ao_button->set_text(TTRC("AO")); environ_ao_button->set_h_size_flags(SIZE_EXPAND_FILL); environ_ao_button->set_toggle_mode(true); environ_ao_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_environ_set_ao), CONNECT_DEFERRED); fx_vb->add_child(environ_ao_button); environ_glow_button = memnew(Button); - environ_glow_button->set_text(TTR("Glow")); + environ_glow_button->set_text(TTRC("Glow")); environ_glow_button->set_h_size_flags(SIZE_EXPAND_FILL); environ_glow_button->set_toggle_mode(true); environ_glow_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_environ_set_glow), CONNECT_DEFERRED); fx_vb->add_child(environ_glow_button); environ_tonemap_button = memnew(Button); - environ_tonemap_button->set_text(TTR("Tonemap")); + environ_tonemap_button->set_text(TTRC("Tonemap")); environ_tonemap_button->set_h_size_flags(SIZE_EXPAND_FILL); environ_tonemap_button->set_toggle_mode(true); environ_tonemap_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_environ_set_tonemap), CONNECT_DEFERRED); fx_vb->add_child(environ_tonemap_button); environ_gi_button = memnew(Button); - environ_gi_button->set_text(TTR("GI")); + environ_gi_button->set_text(TTRC("GI")); environ_gi_button->set_h_size_flags(SIZE_EXPAND_FILL); environ_gi_button->set_toggle_mode(true); environ_gi_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_environ_set_gi), CONNECT_DEFERRED); fx_vb->add_child(environ_gi_button); - environ_vb->add_margin_child(TTR("Post Process"), fx_vb); + environ_vb->add_margin_child(TTRC("Post Process"), fx_vb); environ_add_to_scene = memnew(Button); - environ_add_to_scene->set_text(TTR("Add Environment to Scene")); - environ_add_to_scene->set_tooltip_text(TTR("Adds a WorldEnvironment node matching the preview environment settings to the current scene.\nHold Shift while clicking to also add the preview sun to the current scene.")); + environ_add_to_scene->set_text(TTRC("Add Environment to Scene")); + environ_add_to_scene->set_tooltip_text(TTRC("Adds a WorldEnvironment node matching the preview environment settings to the current scene.\nHold Shift while clicking to also add the preview sun to the current scene.")); environ_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_environment_to_scene).bind(false)); environ_vb->add_spacer(); environ_vb->add_child(environ_add_to_scene);