mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Prevent the main locale from being set to an empty string
This commit is contained in:
parent
3f5b871666
commit
04ac5cbb89
1 changed files with 2 additions and 0 deletions
|
|
@ -464,6 +464,8 @@ String TranslationServer::get_country_name(const String &p_country) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslationServer::set_locale(const String &p_locale) {
|
void TranslationServer::set_locale(const String &p_locale) {
|
||||||
|
ERR_FAIL_COND_MSG(p_locale.is_empty(), "Locale cannot be an empty string.");
|
||||||
|
|
||||||
String new_locale = standardize_locale(p_locale);
|
String new_locale = standardize_locale(p_locale);
|
||||||
if (locale == new_locale) {
|
if (locale == new_locale) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue