mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #107649 from timothyqiu/no-translations-configured
Show "No Translations Configured" message for empty translation preview menu
This commit is contained in:
commit
c21e977e66
1 changed files with 8 additions and 2 deletions
|
@ -45,10 +45,16 @@ void EditorTranslationPreviewMenu::_prepare() {
|
||||||
set_item_checked(-1, true);
|
set_item_checked(-1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vector<String> locales = TranslationServer::get_singleton()->get_loaded_locales();
|
|
||||||
if (!locales.is_empty()) {
|
|
||||||
add_separator();
|
add_separator();
|
||||||
|
|
||||||
|
const Vector<String> locales = TranslationServer::get_singleton()->get_loaded_locales();
|
||||||
|
if (locales.is_empty()) {
|
||||||
|
add_item(TTRC("No Translations Configured"));
|
||||||
|
set_item_tooltip(-1, TTRC("You can add translations in the Project Settings."));
|
||||||
|
set_item_disabled(-1, true);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const String &locale : locales) {
|
for (const String &locale : locales) {
|
||||||
const String name = TranslationServer::get_singleton()->get_locale_name(locale);
|
const String name = TranslationServer::get_singleton()->get_locale_name(locale);
|
||||||
add_radio_check_item(name == locale ? name : name + " [" + locale + "]");
|
add_radio_check_item(name == locale ? name : name + " [" + locale + "]");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue