diff options
Diffstat (limited to 'core/string/translation_domain.cpp')
-rw-r--r-- | core/string/translation_domain.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/string/translation_domain.cpp b/core/string/translation_domain.cpp index 6a5e1b2af8..1ff8dcd752 100644 --- a/core/string/translation_domain.cpp +++ b/core/string/translation_domain.cpp @@ -123,7 +123,7 @@ String TranslationDomain::_double_vowels(const String &p_message) const { } } return res; -}; +} String TranslationDomain::_replace_with_accented_string(const String &p_message) const { String res; @@ -247,7 +247,10 @@ PackedStringArray TranslationDomain::get_loaded_locales() const { PackedStringArray locales; for (const Ref<Translation> &E : translations) { ERR_CONTINUE(E.is_null()); - locales.push_back(E->get_locale()); + const String &locale = E->get_locale(); + if (!locales.has(locale)) { + locales.push_back(locale); + } } return locales; } @@ -389,6 +392,10 @@ void TranslationDomain::set_pseudolocalization_suffix(const String &p_suffix) { } StringName TranslationDomain::pseudolocalize(const StringName &p_message) const { + if (p_message.is_empty()) { + return p_message; + } + String message = p_message; int length = message.length(); if (pseudolocalization.override_enabled) { |