summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 6cc877f8c2..21e5935adc 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -83,6 +83,7 @@
#include "editor/doc_tools.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
+#include "editor/editor_translation.h"
#include "editor/progress_dialog.h"
#include "editor/project_manager.h"
#ifndef NO_EDITOR_SPLASH
@@ -1937,7 +1938,6 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
}
_start_success = true;
- locale = String();
ClassDB::set_current_api(ClassDB::API_NONE); //no more APIs are registered at this point
@@ -2049,6 +2049,11 @@ bool Main::start() {
// Needed to instance editor-only classes for their default values
Engine::get_singleton()->set_editor_hint(true);
+ // Translate the class reference only when `-l LOCALE` parameter is given.
+ if (!locale.is_empty() && locale != "en") {
+ load_doc_translations(locale);
+ }
+
{
DirAccessRef da = DirAccess::open(doc_tool_path);
ERR_FAIL_COND_V_MSG(!da, false, "Argument supplied to --doctool must be a valid directory path.");