@@ -424,28 +424,6 @@ StringName TranslationServer::translate_plural(const StringName &p_message, cons
424424 return main_domain->translate_plural (p_message, p_message_plural, p_n, p_context);
425425}
426426
427- bool TranslationServer::_load_translations (const String &p_from) {
428- if (ProjectSettings::get_singleton ()->has_setting (p_from)) {
429- const Vector<String> &translation_names = GLOBAL_GET (p_from);
430-
431- int tcount = translation_names.size ();
432-
433- if (tcount) {
434- const String *r = translation_names.ptr ();
435-
436- for (int i = 0 ; i < tcount; i++) {
437- Ref<Translation> tr = ResourceLoader::load (r[i]);
438- if (tr.is_valid ()) {
439- add_translation (tr);
440- }
441- }
442- }
443- return true ;
444- }
445-
446- return false ;
447- }
448-
449427bool TranslationServer::has_domain (const StringName &p_domain) const {
450428 if (p_domain == StringName ()) {
451429 return true ;
@@ -641,11 +619,16 @@ void TranslationServer::_bind_methods() {
641619}
642620
643621void TranslationServer::load_translations () {
644- _load_translations (" internationalization/locale/translations" ); // all
645- _load_translations (" internationalization/locale/translations_" + locale.substr (0 , 2 ));
646-
647- if (locale.substr (0 , 2 ) != locale) {
648- _load_translations (" internationalization/locale/translations_" + locale);
622+ const String prop = " internationalization/locale/translations" ;
623+ if (!ProjectSettings::get_singleton ()->has_setting (prop)) {
624+ return ;
625+ }
626+ const Vector<String> &translations = GLOBAL_GET (prop);
627+ for (const String &path : translations) {
628+ Ref<Translation> tr = ResourceLoader::load (path);
629+ if (tr.is_valid ()) {
630+ add_translation (tr);
631+ }
649632 }
650633}
651634
0 commit comments