diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-08-24 16:05:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 16:05:59 +0200 |
commit | 4698dc67b575a93d83933147207b0e57e7a58672 (patch) | |
tree | e182c2313f758d5babf2ab9b8c159a93ac2e9b54 /core | |
parent | 5d14d0870269eb6c4eeb7bff6e8e66dfd0f4773e (diff) | |
parent | f7f4873ed08d6b465c8108f7ce0c1cb76f9caf2f (diff) |
Merge pull request #64082 from KoBeWi/array3k
Diffstat (limited to 'core')
-rw-r--r-- | core/string/translation.cpp | 8 | ||||
-rw-r--r-- | core/string/translation.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/string/translation.cpp b/core/string/translation.cpp index b83b7c786f..4748f1a0cb 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -70,7 +70,7 @@ void Translation::_set_messages(const Dictionary &p_messages) { void Translation::set_locale(const String &p_locale) { locale = TranslationServer::get_singleton()->standardize_locale(p_locale); - if (OS::get_singleton()->get_main_loop() && TranslationServer::get_singleton()->get_loaded_locales().has(this)) { + if (OS::get_singleton()->get_main_loop() && TranslationServer::get_singleton()->get_loaded_locales().has(get_locale())) { OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_TRANSLATION_CHANGED); } } @@ -505,11 +505,11 @@ String TranslationServer::get_locale() const { return locale; } -Array TranslationServer::get_loaded_locales() const { - Array locales; +PackedStringArray TranslationServer::get_loaded_locales() const { + PackedStringArray locales; for (const Ref<Translation> &E : translations) { const Ref<Translation> &t = E; - ERR_FAIL_COND_V(t.is_null(), Array()); + ERR_FAIL_COND_V(t.is_null(), PackedStringArray()); String l = t->get_locale(); locales.push_back(l); diff --git a/core/string/translation.h b/core/string/translation.h index 20c6ebd5a5..3f97a8d4fc 100644 --- a/core/string/translation.h +++ b/core/string/translation.h @@ -145,7 +145,7 @@ public: String get_locale_name(const String &p_locale) const; - Array get_loaded_locales() const; + PackedStringArray get_loaded_locales() const; void add_translation(const Ref<Translation> &p_translation); void remove_translation(const Ref<Translation> &p_translation); |