diff options
Diffstat (limited to 'core/string/translation_server.h')
-rw-r--r-- | core/string/translation_server.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/core/string/translation_server.h b/core/string/translation_server.h index 2438349a69..bc59c34a38 100644 --- a/core/string/translation_server.h +++ b/core/string/translation_server.h @@ -50,7 +50,7 @@ class TranslationServer : public Object { bool enabled = true; - static TranslationServer *singleton; + static inline TranslationServer *singleton = nullptr; bool _load_translations(const String &p_from); String _standardize_locale(const String &p_locale, bool p_add_defaults) const; @@ -64,6 +64,24 @@ class TranslationServer : public Object { }; static Vector<LocaleScriptInfo> locale_script_info; + struct Locale { + String language; + String script; + String country; + String variant; + + bool operator==(const Locale &p_locale) const { + return (p_locale.language == language) && + (p_locale.script == script) && + (p_locale.country == country) && + (p_locale.variant == variant); + } + + operator String() const; + + Locale(const TranslationServer &p_server, const String &p_locale, bool p_add_defaults); + }; + static HashMap<String, String> language_map; static HashMap<String, String> script_map; static HashMap<String, String> locale_rename_map; |