Skip to content

Commit bf4e5cc

Browse files
committed
Make editor's shortcut names translated on-site
1 parent 6e2cf2a commit bf4e5cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+570
-550
lines changed

editor/animation_bezier_editor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1995,9 +1995,9 @@ AnimationBezierTrackEdit::AnimationBezierTrackEdit() {
19951995

19961996
set_clip_contents(true);
19971997

1998-
ED_SHORTCUT("animation_bezier_editor/focus", TTR("Focus"), Key::F);
1999-
ED_SHORTCUT("animation_bezier_editor/select_all_keys", TTR("Select All Keys"), KeyModifierMask::CMD_OR_CTRL | Key::A);
2000-
ED_SHORTCUT("animation_bezier_editor/deselect_all_keys", TTR("Deselect All Keys"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::A);
1998+
ED_SHORTCUT("animation_bezier_editor/focus", TTRC("Focus"), Key::F);
1999+
ED_SHORTCUT("animation_bezier_editor/select_all_keys", TTRC("Select All Keys"), KeyModifierMask::CMD_OR_CTRL | Key::A);
2000+
ED_SHORTCUT("animation_bezier_editor/deselect_all_keys", TTRC("Deselect All Keys"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::A);
20012001

20022002
menu = memnew(PopupMenu);
20032003
add_child(menu);

editor/animation_track_editor.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -7716,7 +7716,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
77167716
bottom_hb->add_child(zoom);
77177717
timeline->set_zoom(zoom);
77187718

7719-
ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F);
7719+
ED_SHORTCUT("animation_editor/auto_fit", TTRC("Fit to panel"), KeyModifierMask::ALT | Key::F);
77207720

77217721
auto_fit = memnew(Button);
77227722
auto_fit->set_flat(true);
@@ -7743,27 +7743,27 @@ AnimationTrackEditor::AnimationTrackEditor() {
77437743
edit->get_popup()->add_item(TTR("Scale Selection..."), EDIT_SCALE_SELECTION);
77447744
edit->get_popup()->add_item(TTR("Scale From Cursor..."), EDIT_SCALE_FROM_CURSOR);
77457745
edit->get_popup()->add_separator();
7746-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/set_start_offset", TTR("Set Start Offset (Audio)"), KeyModifierMask::CMD_OR_CTRL | Key::BRACKETLEFT), EDIT_SET_START_OFFSET);
7747-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/set_end_offset", TTR("Set End Offset (Audio)"), KeyModifierMask::CMD_OR_CTRL | Key::BRACKETRIGHT), EDIT_SET_END_OFFSET);
7746+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/set_start_offset", TTRC("Set Start Offset (Audio)"), KeyModifierMask::CMD_OR_CTRL | Key::BRACKETLEFT), EDIT_SET_START_OFFSET);
7747+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/set_end_offset", TTRC("Set End Offset (Audio)"), KeyModifierMask::CMD_OR_CTRL | Key::BRACKETRIGHT), EDIT_SET_END_OFFSET);
77487748
edit->get_popup()->add_separator();
77497749
edit->get_popup()->add_item(TTR("Make Easing Selection..."), EDIT_EASE_SELECTION);
77507750
edit->get_popup()->add_separator();
7751-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/duplicate_selected_keys", TTR("Duplicate Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::D), EDIT_DUPLICATE_SELECTED_KEYS);
7752-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/cut_selected_keys", TTR("Cut Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::X), EDIT_CUT_KEYS);
7753-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/copy_selected_keys", TTR("Copy Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::C), EDIT_COPY_KEYS);
7754-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/paste_keys", TTR("Paste Keys"), KeyModifierMask::CMD_OR_CTRL | Key::V), EDIT_PASTE_KEYS);
7755-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/add_reset_value", TTR("Add RESET Value(s)")));
7751+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/duplicate_selected_keys", TTRC("Duplicate Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::D), EDIT_DUPLICATE_SELECTED_KEYS);
7752+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/cut_selected_keys", TTRC("Cut Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::X), EDIT_CUT_KEYS);
7753+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/copy_selected_keys", TTRC("Copy Selected Keys"), KeyModifierMask::CMD_OR_CTRL | Key::C), EDIT_COPY_KEYS);
7754+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/paste_keys", TTRC("Paste Keys"), KeyModifierMask::CMD_OR_CTRL | Key::V), EDIT_PASTE_KEYS);
7755+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/add_reset_value", TTRC("Add RESET Value(s)")));
77567756
edit->get_popup()->add_separator();
7757-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/move_first_selected_key_to_cursor", TTR("Move First Selected Key to Cursor"), Key::BRACKETLEFT), EDIT_MOVE_FIRST_SELECTED_KEY_TO_CURSOR);
7758-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/move_last_selected_key_to_cursor", TTR("Move Last Selected Key to Cursor"), Key::BRACKETRIGHT), EDIT_MOVE_LAST_SELECTED_KEY_TO_CURSOR);
7757+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/move_first_selected_key_to_cursor", TTRC("Move First Selected Key to Cursor"), Key::BRACKETLEFT), EDIT_MOVE_FIRST_SELECTED_KEY_TO_CURSOR);
7758+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/move_last_selected_key_to_cursor", TTRC("Move Last Selected Key to Cursor"), Key::BRACKETRIGHT), EDIT_MOVE_LAST_SELECTED_KEY_TO_CURSOR);
77597759
edit->get_popup()->add_separator();
7760-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/delete_selection", TTR("Delete Selection"), Key::KEY_DELETE), EDIT_DELETE_SELECTION);
7760+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/delete_selection", TTRC("Delete Selection"), Key::KEY_DELETE), EDIT_DELETE_SELECTION);
77617761

77627762
edit->get_popup()->add_separator();
7763-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_next_step", TTR("Go to Next Step"), KeyModifierMask::CMD_OR_CTRL | Key::RIGHT), EDIT_GOTO_NEXT_STEP);
7764-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_prev_step", TTR("Go to Previous Step"), KeyModifierMask::CMD_OR_CTRL | Key::LEFT), EDIT_GOTO_PREV_STEP);
7763+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_next_step", TTRC("Go to Next Step"), KeyModifierMask::CMD_OR_CTRL | Key::RIGHT), EDIT_GOTO_NEXT_STEP);
7764+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/goto_prev_step", TTRC("Go to Previous Step"), KeyModifierMask::CMD_OR_CTRL | Key::LEFT), EDIT_GOTO_PREV_STEP);
77657765
edit->get_popup()->add_separator();
7766-
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/apply_reset", TTR("Apply Reset")), EDIT_APPLY_RESET);
7766+
edit->get_popup()->add_shortcut(ED_SHORTCUT("animation_editor/apply_reset", TTRC("Apply Reset")), EDIT_APPLY_RESET);
77677767
edit->get_popup()->add_separator();
77687768
edit->get_popup()->add_item(TTR("Bake Animation..."), EDIT_BAKE_ANIMATION);
77697769
edit->get_popup()->add_item(TTR("Optimize Animation (no undo)..."), EDIT_OPTIMIZE_ANIMATION);
@@ -9045,9 +9045,9 @@ AnimationMarkerEdit::AnimationMarkerEdit() {
90459045
menu = memnew(PopupMenu);
90469046
add_child(menu);
90479047
menu->connect(SceneStringName(id_pressed), callable_mp(this, &AnimationMarkerEdit::_menu_selected));
9048-
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/rename_marker", TTR("Rename Marker"), Key::R), MENU_KEY_RENAME);
9049-
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/delete_selection", TTR("Delete Marker(s)"), Key::KEY_DELETE), MENU_KEY_DELETE);
9050-
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/toggle_marker_names", TTR("Show All Marker Names"), Key::M), MENU_KEY_TOGGLE_MARKER_NAMES);
9048+
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/rename_marker", TTRC("Rename Marker"), Key::R), MENU_KEY_RENAME);
9049+
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/delete_selection", TTRC("Delete Marker(s)"), Key::KEY_DELETE), MENU_KEY_DELETE);
9050+
menu->add_shortcut(ED_SHORTCUT("animation_marker_edit/toggle_marker_names", TTRC("Show All Marker Names"), Key::M), MENU_KEY_TOGGLE_MARKER_NAMES);
90519051

90529052
marker_insert_confirm = memnew(ConfirmationDialog);
90539053
marker_insert_confirm->set_title(TTR("Insert Marker"));

editor/code_editor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1786,9 +1786,9 @@ void CodeTextEditor::update_toggle_scripts_button() {
17861786

17871787
CodeTextEditor::CodeTextEditor() {
17881788
code_complete_func = nullptr;
1789-
ED_SHORTCUT("script_editor/zoom_in", TTR("Zoom In"), KeyModifierMask::CMD_OR_CTRL | Key::EQUAL);
1790-
ED_SHORTCUT("script_editor/zoom_out", TTR("Zoom Out"), KeyModifierMask::CMD_OR_CTRL | Key::MINUS);
1791-
ED_SHORTCUT_ARRAY("script_editor/reset_zoom", TTR("Reset Zoom"),
1789+
ED_SHORTCUT("script_editor/zoom_in", TTRC("Zoom In"), KeyModifierMask::CMD_OR_CTRL | Key::EQUAL);
1790+
ED_SHORTCUT("script_editor/zoom_out", TTRC("Zoom Out"), KeyModifierMask::CMD_OR_CTRL | Key::MINUS);
1791+
ED_SHORTCUT_ARRAY("script_editor/reset_zoom", TTRC("Reset Zoom"),
17921792
{ int32_t(KeyModifierMask::CMD_OR_CTRL | Key::KEY_0), int32_t(KeyModifierMask::CMD_OR_CTRL | Key::KP_0) });
17931793

17941794
text_editor = memnew(CodeEdit);

editor/connections_dialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1648,7 +1648,7 @@ ConnectionsDock::ConnectionsDock() {
16481648
slot_menu->connect("about_to_popup", callable_mp(this, &ConnectionsDock::_slot_menu_about_to_popup));
16491649
slot_menu->add_item(TTR("Edit..."), SLOT_MENU_EDIT);
16501650
slot_menu->add_item(TTR("Go to Method"), SLOT_MENU_GO_TO_METHOD);
1651-
slot_menu->add_shortcut(ED_SHORTCUT("connections_editor/disconnect", TTR("Disconnect"), Key::KEY_DELETE), SLOT_MENU_DISCONNECT);
1651+
slot_menu->add_shortcut(ED_SHORTCUT("connections_editor/disconnect", TTRC("Disconnect"), Key::KEY_DELETE), SLOT_MENU_DISCONNECT);
16521652
add_child(slot_menu);
16531653

16541654
connect_dialog->connect("connected", callable_mp(this, &ConnectionsDock::_make_or_edit_connection));

editor/editor_audio_buses.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,8 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
995995
hbc->add_child(bus_options);
996996

997997
bus_popup = bus_options->get_popup();
998-
bus_popup->add_shortcut(ED_SHORTCUT("audio_bus_editor/duplicate_selected_bus", TTR("Duplicate Bus"), KeyModifierMask::CMD_OR_CTRL | Key::D));
999-
bus_popup->add_shortcut(ED_SHORTCUT("audio_bus_editor/delete_selected_bus", TTR("Delete Bus"), Key::KEY_DELETE));
998+
bus_popup->add_shortcut(ED_SHORTCUT("audio_bus_editor/duplicate_selected_bus", TTRC("Duplicate Bus"), KeyModifierMask::CMD_OR_CTRL | Key::D));
999+
bus_popup->add_shortcut(ED_SHORTCUT("audio_bus_editor/delete_selected_bus", TTRC("Delete Bus"), Key::KEY_DELETE));
10001000
bus_popup->set_item_disabled(1, is_master);
10011001
bus_popup->add_item(TTR("Reset Volume"));
10021002
bus_popup->connect("index_pressed", callable_mp(this, &EditorAudioBus::_bus_popup_pressed));
@@ -1082,7 +1082,7 @@ void EditorAudioBuses::_rebuild_buses() {
10821082

10831083
EditorAudioBuses *EditorAudioBuses::register_editor() {
10841084
EditorAudioBuses *audio_buses = memnew(EditorAudioBuses);
1085-
EditorNode::get_bottom_panel()->add_item(TTR("Audio"), audio_buses, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_audio_bottom_panel", TTR("Toggle Audio Bottom Panel"), KeyModifierMask::ALT | Key::A));
1085+
EditorNode::get_bottom_panel()->add_item(TTR("Audio"), audio_buses, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_audio_bottom_panel", TTRC("Toggle Audio Bottom Panel"), KeyModifierMask::ALT | Key::A));
10861086
return audio_buses;
10871087
}
10881088

editor/editor_inspector.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -4708,9 +4708,9 @@ EditorInspector::EditorInspector() {
47084708
refresh_countdown = 0.33;
47094709
}
47104710

4711-
ED_SHORTCUT("property_editor/copy_value", TTR("Copy Value"), KeyModifierMask::CMD_OR_CTRL | Key::C);
4712-
ED_SHORTCUT("property_editor/paste_value", TTR("Paste Value"), KeyModifierMask::CMD_OR_CTRL | Key::V);
4713-
ED_SHORTCUT("property_editor/copy_property_path", TTR("Copy Property Path"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::C);
4711+
ED_SHORTCUT("property_editor/copy_value", TTRC("Copy Value"), KeyModifierMask::CMD_OR_CTRL | Key::C);
4712+
ED_SHORTCUT("property_editor/paste_value", TTRC("Paste Value"), KeyModifierMask::CMD_OR_CTRL | Key::V);
4713+
ED_SHORTCUT("property_editor/copy_property_path", TTRC("Copy Property Path"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::C);
47144714

47154715
// `use_settings_name_style` is true by default, set the name style accordingly.
47164716
set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());

editor/editor_log.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,15 @@ EditorLog::EditorLog() {
486486
clear_button = memnew(Button);
487487
clear_button->set_theme_type_variation(SceneStringName(FlatButton));
488488
clear_button->set_focus_mode(FOCUS_NONE);
489-
clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::K));
489+
clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTRC("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::K));
490490
clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_clear_request));
491491
hb_tools->add_child(clear_button);
492492

493493
// Copy.
494494
copy_button = memnew(Button);
495495
copy_button->set_theme_type_variation(SceneStringName(FlatButton));
496496
copy_button->set_focus_mode(FOCUS_NONE);
497-
copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C));
497+
copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTRC("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C));
498498
copy_button->set_shortcut_context(this);
499499
copy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_copy_request));
500500
hb_tools->add_child(copy_button);
@@ -523,7 +523,7 @@ EditorLog::EditorLog() {
523523
show_search_button->set_focus_mode(FOCUS_NONE);
524524
show_search_button->set_toggle_mode(true);
525525
show_search_button->set_pressed(true);
526-
show_search_button->set_shortcut(ED_SHORTCUT("editor/open_search", TTR("Focus Search/Filter Bar"), KeyModifierMask::CMD_OR_CTRL | Key::F));
526+
show_search_button->set_shortcut(ED_SHORTCUT("editor/open_search", TTRC("Focus Search/Filter Bar"), KeyModifierMask::CMD_OR_CTRL | Key::F));
527527
show_search_button->set_shortcut_context(this);
528528
show_search_button->connect(SceneStringName(toggled), callable_mp(this, &EditorLog::_set_search_visible));
529529
hb_tools2->add_child(show_search_button);

0 commit comments

Comments
 (0)