File tree Expand file tree Collapse file tree 2 files changed +0
-18
lines changed
Expand file tree Collapse file tree 2 files changed +0
-18
lines changed Original file line number Diff line number Diff line change 3030
3131#include " translation.h"
3232
33- #include " core/os/os.h"
3433#include " core/os/thread.h"
3534#include " core/string/translation_server.h"
3635
@@ -74,21 +73,6 @@ void Translation::_set_messages(const Dictionary &p_messages) {
7473
7574void Translation::set_locale (const String &p_locale) {
7675 locale = TranslationServer::get_singleton ()->standardize_locale (p_locale);
77-
78- if (Thread::is_main_thread ()) {
79- _notify_translation_changed_if_applies ();
80- } else {
81- // This has to happen on the main thread (bypassing the ResourceLoader per-thread call queue)
82- // because it interacts with the generally non-thread-safe window management, leading to
83- // different issues across platforms otherwise.
84- MessageQueue::get_main_singleton ()->push_callable (callable_mp (this , &Translation::_notify_translation_changed_if_applies));
85- }
86- }
87-
88- void Translation::_notify_translation_changed_if_applies () {
89- if (OS::get_singleton ()->get_main_loop () && TranslationServer::get_singleton ()->get_loaded_locales ().has (get_locale ())) {
90- OS::get_singleton ()->get_main_loop ()->notification (MainLoop::NOTIFICATION_TRANSLATION_CHANGED);
91- }
9276}
9377
9478void Translation::add_message (const StringName &p_src_text, const StringName &p_xlated_text, const StringName &p_context) {
Original file line number Diff line number Diff line change @@ -45,8 +45,6 @@ class Translation : public Resource {
4545 virtual Dictionary _get_messages () const ;
4646 virtual void _set_messages (const Dictionary &p_messages);
4747
48- void _notify_translation_changed_if_applies ();
49-
5048protected:
5149 static void _bind_methods ();
5250
You can’t perform that action at this time.
0 commit comments