Skip to content

Commit 3fe69cd

Browse files
committed
Merge pull request godotengine#104698 from bruvzg/loc_dir
Fix editor layout direction change on translation change.
2 parents 4a31936 + c392195 commit 3fe69cd

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

core/string/translation_server.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ String TranslationServer::get_tool_locale() {
504504
#ifdef TOOLS_ENABLED
505505
if (Engine::get_singleton()->is_editor_hint() || Engine::get_singleton()->is_project_manager_hint()) {
506506
const PackedStringArray &locales = editor_domain->get_loaded_locales();
507-
if (locales.is_empty()) {
508-
return "en";
507+
if (locales.has(locale)) {
508+
return locale;
509509
}
510-
return locales[0];
510+
return "en";
511511
} else {
512512
#else
513513
{

editor/editor_node.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ bool EditorNode::_is_project_data_missing() {
658658

659659
void EditorNode::_notification(int p_what) {
660660
switch (p_what) {
661+
case NOTIFICATION_TRANSLATION_CHANGED: {
662+
callable_mp(this, &EditorNode::_titlebar_resized).call_deferred();
663+
} break;
664+
661665
case NOTIFICATION_POSTINITIALIZE: {
662666
EditorHelp::generate_doc();
663667
#if defined(MODULE_GDSCRIPT_ENABLED) || defined(MODULE_MONO_ENABLED)

editor/project_manager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ void ProjectManager::_notification(int p_what) {
9797
_titlebar_resized();
9898
} break;
9999

100+
case NOTIFICATION_TRANSLATION_CHANGED: {
101+
_titlebar_resized();
102+
} break;
103+
100104
case NOTIFICATION_VISIBILITY_CHANGED: {
101105
set_process_shortcut_input(is_visible_in_tree());
102106
} break;

0 commit comments

Comments
 (0)