From c7b91309f24ccd4e406d12a2e898fbec327fe0f0 Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Mon, 22 Feb 2021 15:16:46 +0200 Subject: [PATCH] Initialize `TranslationServer` in the test environment --- main/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 657a6ad822f..a0512a29611 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -400,6 +400,8 @@ Error Main::test_setup() { GLOBAL_DEF("debug/settings/crash_handler/message", String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues")); + translation_server = memnew(TranslationServer); + // From `Main::setup2()`. preregister_module_types(); preregister_server_types(); @@ -407,6 +409,16 @@ Error Main::test_setup() { register_core_singletons(); register_server_types(); + + translation_server->setup(); //register translations, load them, etc. + if (locale != "") { + translation_server->set_locale(locale); + } + translation_server->load_translations(); + ResourceLoader::load_translation_remaps(); //load remaps for resources + + ResourceLoader::load_path_remaps(); + register_scene_types(); #ifdef TOOLS_ENABLED @@ -446,6 +458,9 @@ void Main::test_cleanup() { OS::get_singleton()->finalize(); + if (translation_server) { + memdelete(translation_server); + } if (globals) { memdelete(globals); }