From 24c52f8d67c4fe3626fcd7c10c5f96eacebad23a Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 30 Nov 2021 13:13:39 +0100 Subject: [PATCH] Improve language lists in localization editor (cherry picked from commit 30df260810c0d1783b1afed60a085b2b9fae9df4) --- editor/project_manager.cpp | 2 +- editor/project_settings_editor.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c3f57824186..acc21cb8d25 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2639,7 +2639,7 @@ ProjectManager::ProjectManager() { for (int i = 0; i < editor_languages.size(); i++) { String lang = editor_languages[i]; String lang_name = TranslationServer::get_singleton()->get_locale_name(lang); - language_btn->add_item(lang_name + " [" + lang + "]", i); + language_btn->add_item(vformat("[%s] %s", lang, lang_name), i); language_btn->set_item_metadata(i, lang); if (current_lang == lang) { language_btn->select(i); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index d55c014ec1b..907c87c0a66 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -1577,7 +1577,7 @@ void ProjectSettingsEditor::_update_translations() { TreeItem *t = translation_filter->create_item(root); t->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - t->set_text(0, n); + t->set_text(0, vformat("[%s] %s", l, n)); t->set_editable(0, true); t->set_tooltip(0, l); t->set_checked(0, is_checked); @@ -1618,7 +1618,7 @@ void ProjectSettingsEditor::_update_translations() { if (langnames.length() > 0) { langnames += ","; } - langnames += names[i]; + langnames += vformat("[%s] %s", langs[i], names[i]); translation_locales_idxs_remap.write[l_idx] = i; l_idx++; } @@ -1627,7 +1627,7 @@ void ProjectSettingsEditor::_update_translations() { if (i > 0) { langnames += ","; } - langnames += names[i]; + langnames += vformat("[%s] %s", langs[i], names[i]); } }