Procházet zdrojové kódy

Make translation change notification when setting the locale of a Translation resource only happen when loaded in the server

Michael Alexsander před 5 roky
rodič
revize
4f08174413
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      core/string/translation.cpp

+ 1 - 1
core/string/translation.cpp

@@ -835,7 +835,7 @@ void Translation::set_locale(const String &p_locale) {
 		locale = univ_locale;
 	}
 
-	if (OS::get_singleton()->get_main_loop()) {
+	if (OS::get_singleton()->get_main_loop() && TranslationServer::get_singleton()->get_loaded_locales().has(this)) {
 		OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_TRANSLATION_CHANGED);
 	}
 }