Skip to content

Commit b291156

Browse files
committed
Inspector localization improvements
1 parent 594d64e commit b291156

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
@@ -4750,6 +4750,12 @@ void EditorInspector::_clear_current_favorites() {
47504750

47514751
void EditorInspector::_notification(int p_what) {
47524752
switch (p_what) {
4753+
case NOTIFICATION_TRANSLATION_CHANGED: {
4754+
if (property_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
4755+
update_tree_pending = true;
4756+
}
4757+
} break;
4758+
47534759
case NOTIFICATION_THEME_CHANGED: {
47544760
favorites_category->icon = get_editor_theme_icon(SNAME("Favorites"));
47554761

@@ -4830,7 +4836,6 @@ void EditorInspector::_notification(int p_what) {
48304836
} break;
48314837

48324838
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
4833-
bool needs_update = false;
48344839
if (!is_sub_inspector() && EditorThemeManager::is_generated_theme_outdated()) {
48354840
add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
48364841
}
@@ -4839,16 +4844,12 @@ void EditorInspector::_notification(int p_what) {
48394844
EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_settings_style();
48404845
if (property_name_style != style) {
48414846
property_name_style = style;
4842-
needs_update = true;
4847+
update_tree_pending = true;
48434848
}
48444849
}
48454850

48464851
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/inspector")) {
4847-
needs_update = true;
4848-
}
4849-
4850-
if (needs_update) {
4851-
update_tree();
4852+
update_tree_pending = true;
48524853
}
48534854
} break;
48544855
}

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
@@ -442,8 +442,11 @@ Container *InspectorDock::get_addon_area() {
442442

443443
void InspectorDock::_notification(int p_what) {
444444
switch (p_what) {
445+
case NOTIFICATION_TRANSLATION_CHANGED: {
446+
update(current);
447+
[[fallthrough]];
448+
}
445449
case NOTIFICATION_THEME_CHANGED:
446-
case NOTIFICATION_TRANSLATION_CHANGED:
447450
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
448451
resource_new_button->set_button_icon(get_editor_theme_icon(SNAME("New")));
449452
resource_load_button->set_button_icon(get_editor_theme_icon(SNAME("Load")));

0 commit comments

Comments
 (0)