1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #104701 from KoBeWi/inspecktore

Inspector localization improvements
This commit is contained in:
Rémi Verschelde
2025-03-28 14:34:56 +01:00
3 changed files with 13 additions and 13 deletions

View File

@@ -4757,6 +4757,12 @@ void EditorInspector::_clear_current_favorites() {
void EditorInspector::_notification(int p_what) { void EditorInspector::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_TRANSLATION_CHANGED: {
if (property_name_style == EditorPropertyNameProcessor::STYLE_LOCALIZED) {
update_tree_pending = true;
}
} break;
case NOTIFICATION_THEME_CHANGED: { case NOTIFICATION_THEME_CHANGED: {
favorites_category->icon = get_editor_theme_icon(SNAME("Favorites")); favorites_category->icon = get_editor_theme_icon(SNAME("Favorites"));
@@ -4837,7 +4843,6 @@ void EditorInspector::_notification(int p_what) {
} break; } break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
bool needs_update = false;
if (!is_sub_inspector() && EditorThemeManager::is_generated_theme_outdated()) { if (!is_sub_inspector() && EditorThemeManager::is_generated_theme_outdated()) {
add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))); add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
} }
@@ -4846,16 +4851,12 @@ void EditorInspector::_notification(int p_what) {
EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_settings_style(); EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_settings_style();
if (property_name_style != style) { if (property_name_style != style) {
property_name_style = style; property_name_style = style;
needs_update = true; update_tree_pending = true;
} }
} }
if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/inspector")) { if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/inspector")) {
needs_update = true; update_tree_pending = true;
}
if (needs_update) {
update_tree();
} }
} break; } break;
} }

View File

@@ -59,11 +59,7 @@ EditorPropertyNameProcessor::Style EditorPropertyNameProcessor::get_tooltip_styl
} }
bool EditorPropertyNameProcessor::is_localization_available() { bool EditorPropertyNameProcessor::is_localization_available() {
if (!EditorSettings::get_singleton()) { return EditorSettings::get_singleton() && EDITOR_GET("interface/editor/editor_language") != "en";
return false;
}
const Vector<String> forbidden = String("en").split(",");
return !forbidden.has(EDITOR_GET("interface/editor/editor_language"));
} }
String EditorPropertyNameProcessor::_capitalize_name(const String &p_name) const { String EditorPropertyNameProcessor::_capitalize_name(const String &p_name) const {

View File

@@ -457,8 +457,11 @@ Container *InspectorDock::get_addon_area() {
void InspectorDock::_notification(int p_what) { void InspectorDock::_notification(int p_what) {
switch (p_what) { switch (p_what) {
case NOTIFICATION_TRANSLATION_CHANGED: {
update(current);
[[fallthrough]];
}
case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED:
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: { case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
resource_new_button->set_button_icon(get_editor_theme_icon(SNAME("New"))); resource_new_button->set_button_icon(get_editor_theme_icon(SNAME("New")));
resource_load_button->set_button_icon(get_editor_theme_icon(SNAME("Load"))); resource_load_button->set_button_icon(get_editor_theme_icon(SNAME("Load")));