1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Move pseudolocalization into TranslationDomain

Also adds command-line option `--editor-pseudolocalization`
This commit is contained in:
Haoyu Qiu
2024-08-28 23:03:23 +08:00
parent e4e024ab88
commit cca54ba4db
7 changed files with 421 additions and 236 deletions

View File

@@ -243,6 +243,7 @@ static MovieWriter *movie_writer = nullptr;
static bool disable_vsync = false;
static bool print_fps = false;
#ifdef TOOLS_ENABLED
static bool editor_pseudolocalization = false;
static bool dump_gdextension_interface = false;
static bool dump_extension_api = false;
static bool include_docs_in_extension_api_dump = false;
@@ -629,6 +630,9 @@ void Main::print_help(const char *p_binary) {
print_help_option("--fixed-fps <fps>", "Force a fixed number of frames per second. This setting disables real-time synchronization.\n");
print_help_option("--delta-smoothing <enable>", "Enable or disable frame delta smoothing [\"enable\", \"disable\"].\n");
print_help_option("--print-fps", "Print the frames per second to the stdout.\n");
#ifdef TOOLS_ENABLED
print_help_option("--editor-pseudolocalization", "Enable pseudolocalization for the editor and the project manager.\n");
#endif
print_help_title("Standalone tools");
print_help_option("-s, --script <script>", "Run a script.\n");
@@ -1683,6 +1687,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
disable_vsync = true;
} else if (arg == "--print-fps") {
print_fps = true;
#ifdef TOOLS_ENABLED
} else if (arg == "--editor-pseudolocalization") {
editor_pseudolocalization = true;
#endif // TOOLS_ENABLED
} else if (arg == "--profile-gpu") {
profile_gpu = true;
} else if (arg == "--disable-crash-handler") {
@@ -3963,6 +3971,11 @@ int Main::start() {
if (editor) {
OS::get_singleton()->benchmark_begin_measure("Startup", "Editor");
editor_node = memnew(EditorNode);
if (editor_pseudolocalization) {
translation_server->get_editor_domain()->set_pseudolocalization_enabled(true);
}
sml->get_root()->add_child(editor_node);
if (!_export_preset.is_empty()) {
@@ -4158,6 +4171,11 @@ int Main::start() {
ProjectManager *pmanager = memnew(ProjectManager);
ProgressDialog *progress_dialog = memnew(ProgressDialog);
pmanager->add_child(progress_dialog);
if (editor_pseudolocalization) {
translation_server->get_editor_domain()->set_pseudolocalization_enabled(true);
}
sml->get_root()->add_child(pmanager);
OS::get_singleton()->benchmark_end_measure("Startup", "Project Manager");
}