@@ -85,7 +85,7 @@ String ActionMapEditor::_check_new_action_name(const String &p_name) {
8585}
8686
8787void ActionMapEditor::_add_edit_text_changed (const String &p_name) {
88- String error = _check_new_action_name (p_name);
88+ const String error = _check_new_action_name (p_name);
8989 add_button->set_tooltip_text (error);
9090 add_button->set_disabled (!error.is_empty ());
9191}
@@ -361,6 +361,15 @@ void ActionMapEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data,
361361
362362void ActionMapEditor::_notification (int p_what) {
363363 switch (p_what) {
364+ case NOTIFICATION_TRANSLATION_CHANGED: {
365+ if (!actions_cache.is_empty ()) {
366+ update_action_list ();
367+ }
368+ if (!add_button->get_tooltip_text ().is_empty ()) {
369+ _add_edit_text_changed (add_edit->get_text ());
370+ }
371+ } break ;
372+
364373 case NOTIFICATION_THEME_CHANGED: {
365374 action_list_search->set_right_icon (get_editor_theme_icon (SNAME (" Search" )));
366375 add_button->set_button_icon (get_editor_theme_icon (SNAME (" Add" )));
@@ -455,10 +464,10 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
455464 bool events_eq = Shortcut::is_event_array_equal (action_info.action_initial [" events" ], action_info.action [" events" ]);
456465 bool action_eq = deadzone_eq && events_eq;
457466 action_item->set_meta (" __action_initial" , action_info.action_initial );
458- action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" ReloadSmall" )), BUTTON_REVERT_ACTION, action_eq, action_eq ? TTR (" Cannot Revert - Action is same as initial" ) : TTR (" Revert Action" ));
467+ action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" ReloadSmall" )), BUTTON_REVERT_ACTION, action_eq, action_eq ? TTRC (" Cannot Revert - Action is same as initial" ) : TTRC (" Revert Action" ));
459468 }
460- action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Add" )), BUTTON_ADD_EVENT, false , TTR (" Add Event" ));
461- action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Remove" )), BUTTON_REMOVE_ACTION, !action_info.editable , action_info.editable ? TTR (" Remove Action" ) : TTR (" Cannot Remove Action" ));
469+ action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Add" )), BUTTON_ADD_EVENT, false , TTRC (" Add Event" ));
470+ action_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Remove" )), BUTTON_REMOVE_ACTION, !action_info.editable , action_info.editable ? TTRC (" Remove Action" ) : TTRC (" Cannot Remove Action" ));
462471
463472 action_item->set_custom_bg_color (0 , action_tree->get_theme_color (SNAME (" prop_subsection" ), EditorStringName (Editor)));
464473 action_item->set_custom_bg_color (1 , action_tree->get_theme_color (SNAME (" prop_subsection" ), EditorStringName (Editor)));
@@ -506,8 +515,8 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
506515 }
507516
508517 // Third Column - Buttons
509- event_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Edit" )), BUTTON_EDIT_EVENT, false , TTR (" Edit Event" ), TTR (" Edit Event" ));
510- event_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Remove" )), BUTTON_REMOVE_EVENT, false , TTR (" Remove Event" ), TTR (" Remove Event" ));
518+ event_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Edit" )), BUTTON_EDIT_EVENT, false , TTRC (" Edit Event" ), TTRC (" Edit Event" ));
519+ event_item->add_button (2 , action_tree->get_editor_theme_icon (SNAME (" Remove" )), BUTTON_REMOVE_EVENT, false , TTRC (" Remove Event" ), TTRC (" Remove Event" ));
511520 event_item->set_button_color (2 , 0 , Color (1 , 1 , 1 , 0.75 ));
512521 event_item->set_button_color (2 , 1 , Color (1 , 1 , 1 , 0.75 ));
513522 }
@@ -547,7 +556,7 @@ ActionMapEditor::ActionMapEditor() {
547556
548557 action_list_search = memnew (LineEdit);
549558 action_list_search->set_h_size_flags (Control::SIZE_EXPAND_FILL);
550- action_list_search->set_placeholder (TTR (" Filter by Name" ));
559+ action_list_search->set_placeholder (TTRC (" Filter by Name" ));
551560 action_list_search->set_accessibility_name (TTRC (" Filter by Name" ));
552561 action_list_search->set_clear_button_enabled (true );
553562 action_list_search->connect (SceneStringName (text_changed), callable_mp (this , &ActionMapEditor::_search_term_updated));
@@ -563,8 +572,8 @@ ActionMapEditor::ActionMapEditor() {
563572 top_hbox->add_child (action_list_search_by_event);
564573
565574 clear_all_search = memnew (Button);
566- clear_all_search->set_text (TTR (" Clear All" ));
567- clear_all_search->set_tooltip_text (TTR (" Clear all search filters." ));
575+ clear_all_search->set_text (TTRC (" Clear All" ));
576+ clear_all_search->set_tooltip_text (TTRC (" Clear all search filters." ));
568577 clear_all_search->connect (SceneStringName (pressed), callable_mp (action_list_search_by_event, &EventListenerLineEdit::clear_event));
569578 clear_all_search->connect (SceneStringName (pressed), callable_mp (action_list_search, &LineEdit::clear));
570579 top_hbox->add_child (clear_all_search);
@@ -575,7 +584,7 @@ ActionMapEditor::ActionMapEditor() {
575584
576585 add_edit = memnew (LineEdit);
577586 add_edit->set_h_size_flags (Control::SIZE_EXPAND_FILL);
578- add_edit->set_placeholder (TTR (" Add New Action" ));
587+ add_edit->set_placeholder (TTRC (" Add New Action" ));
579588 add_edit->set_accessibility_name (TTRC (" Add New Action" ));
580589 add_edit->set_clear_button_enabled (true );
581590 add_edit->set_keep_editing_on_text_submit (true );
@@ -584,7 +593,7 @@ ActionMapEditor::ActionMapEditor() {
584593 add_hbox->add_child (add_edit);
585594
586595 add_button = memnew (Button);
587- add_button->set_text (TTR (" Add" ));
596+ add_button->set_text (TTRC (" Add" ));
588597 add_button->connect (SceneStringName (pressed), callable_mp (this , &ActionMapEditor::_add_action_pressed));
589598 add_hbox->add_child (add_button);
590599 // Disable the button and set its tooltip.
@@ -593,7 +602,7 @@ ActionMapEditor::ActionMapEditor() {
593602 add_hbox->add_child (memnew (VSeparator));
594603
595604 show_builtin_actions_checkbutton = memnew (CheckButton);
596- show_builtin_actions_checkbutton->set_text (TTR (" Show Built-in Actions" ));
605+ show_builtin_actions_checkbutton->set_text (TTRC (" Show Built-in Actions" ));
597606 show_builtin_actions_checkbutton->connect (SceneStringName (toggled), callable_mp (this , &ActionMapEditor::set_show_builtin_actions));
598607 add_hbox->add_child (show_builtin_actions_checkbutton);
599608
@@ -609,9 +618,9 @@ ActionMapEditor::ActionMapEditor() {
609618 action_tree->set_columns (3 );
610619 action_tree->set_hide_root (true );
611620 action_tree->set_column_titles_visible (true );
612- action_tree->set_column_title (0 , TTR (" Action" ));
621+ action_tree->set_column_title (0 , TTRC (" Action" ));
613622 action_tree->set_column_clip_content (0 , true );
614- action_tree->set_column_title (1 , TTR (" Deadzone" ));
623+ action_tree->set_column_title (1 , TTRC (" Deadzone" ));
615624 action_tree->set_column_expand (1 , false );
616625 action_tree->set_column_custom_minimum_width (1 , 80 * EDSCALE);
617626 action_tree->set_column_expand (2 , false );
0 commit comments