Skip to content

Commit 5ce9619

Browse files
committed
Merge pull request godotengine#104701 from KoBeWi/inspecktore
Inspector localization improvements
2 parents 3fe69cd + b291156 commit 5ce9619

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

editor/editor_inspector.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4757,6 +4757,12 @@ void EditorInspector::_clear_current_favorites() {
47574757

47584758
void EditorInspector::_notification(int p_what) {
47594759
switch (p_what) {
4760+
case NOTIFICATION_TRANSLATION_CHANGED: {
4761+
if (property_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
4762+
update_tree_pending = true;
4763+
}
4764+
} break;
4765+
47604766
case NOTIFICATION_THEME_CHANGED: {
47614767
favorites_category->icon = get_editor_theme_icon(SNAME("Favorites"));
47624768

@@ -4837,7 +4843,6 @@ void EditorInspector::_notification(int p_what) {
48374843
} break;
48384844

48394845
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
4840-
bool needs_update = false;
48414846
if (!is_sub_inspector() && EditorThemeManager::is_generated_theme_outdated()) {
48424847
add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
48434848
}
@@ -4846,16 +4851,12 @@ void EditorInspector::_notification(int p_what) {
48464851
EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_settings_style();
48474852
if (property_name_style != style) {
48484853
property_name_style = style;
4849-
needs_update = true;
4854+
update_tree_pending = true;
48504855
}
48514856
}
48524857

48534858
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/inspector")) {
4854-
needs_update = true;
4855-
}
4856-
4857-
if (needs_update) {
4858-
update_tree();
4859+
update_tree_pending = true;
48594860
}
48604861
} break;
48614862
}

editor/editor_property_name_processor.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_tooltip_styl
5959
}
6060

6161
bool EditorPropertyNameProcessor::is_localization_available() {
62-
if (!EditorSettings::get_singleton()) {
63-
return false;
64-
}
65-
const Vector<String> forbidden = String("en").split(",");
66-
return !forbidden.has(EDITOR_GET("interface/editor/editor_language"));
62+
return EditorSettings::get_singleton() && EDITOR_GET("interface/editor/editor_language") != "en";
6763
}
6864

6965
String EditorPropertyNameProcessor::_capitalize_name(const String &p_name) const {

editor/inspector_dock.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,11 @@ Container *InspectorDock::get_addon_area() {
457457

458458
void InspectorDock::_notification(int p_what) {
459459
switch (p_what) {
460+
case NOTIFICATION_TRANSLATION_CHANGED: {
461+
update(current);
462+
[[fallthrough]];
463+
}
460464
case NOTIFICATION_THEME_CHANGED:
461-
case NOTIFICATION_TRANSLATION_CHANGED:
462465
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
463466
resource_new_button->set_button_icon(get_editor_theme_icon(SNAME("New")));
464467
resource_load_button->set_button_icon(get_editor_theme_icon(SNAME("Load")));

0 commit comments

Comments
 (0)