diff options
author | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2021-02-22 15:16:46 +0200 |
---|---|---|
committer | Andrii Doroshenko (Xrayez) <xrayez@gmail.com> | 2021-02-22 15:16:46 +0200 |
commit | c7b91309f24ccd4e406d12a2e898fbec327fe0f0 (patch) | |
tree | 88d1d33a995af65d27c960d1b69393e48fa50f5b /main | |
parent | 5525cd85c60455b0bb9716bbef0ad2ad8111d752 (diff) |
Initialize `TranslationServer` in the test environment
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index 657a6ad822..a0512a2961 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); } |