gui2/title_screen: Don't display locale identifiers on the Language button

CC #6205
This commit is contained in:
Iris Morelle 2021-10-17 22:29:44 -03:00
parent 869926a2b4
commit c1005f2d1f
No known key found for this signature in database
GPG key ID: E312033F4023A753
2 changed files with 7 additions and 3 deletions

View file

@ -16,6 +16,7 @@
* Updated translations: British English, Czech, Italian, Japanese, Portuguese (Brazil), Spanish.
### Units
### User interface
* Don't display the locale API identifier on the Language button (issue #6205).
### WML Engine
### Miscellaneous and Bug Fixes

View file

@ -326,9 +326,12 @@ void title_screen::pre_show(window& win)
return lang.localename == boost_name;
});
// If somehow the locale doesn't match a known translation, use the
// locale identifier as a last resort
lang_button->set_label(lang_def != langs.end() ? lang_def->language.str() : locale.name());
// If the locale doesn't match a known translation, we might be using the System Default
// Language option (issue #6205 <https://github.com/wesnoth/wesnoth/issues/6205>) or
// something weirder is up. Use the WML-defined default label instead in that case.
if(lang_def != langs.end()) {
lang_button->set_label(lang_def->language.str());
}
}
//