Merge pull request #46313 from goostengine/tests-init-translation-server
Initialize `TranslationServer` in the test environment
This commit is contained in:
commit
a0cb81b119
1 changed files with 15 additions and 0 deletions
|
@ -395,6 +395,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();
|
||||
|
@ -402,6 +404,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
|
||||
|
@ -441,6 +453,9 @@ void Main::test_cleanup() {
|
|||
|
||||
OS::get_singleton()->finalize();
|
||||
|
||||
if (translation_server) {
|
||||
memdelete(translation_server);
|
||||
}
|
||||
if (globals) {
|
||||
memdelete(globals);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue