Skip to content

Commit

Permalink
Add editor pseudolocalization support.
Browse files Browse the repository at this point in the history
Moves localized number formatting methods from TextServer to TranslationServer.
Adds support for localized numbers pseudolocalization.
Adds editor/project manager pseudolocalization support.
  • Loading branch information
bruvzg committed Aug 27, 2024
1 parent db76de5 commit 0ea6685
Show file tree
Hide file tree
Showing 32 changed files with 757 additions and 406 deletions.
3 changes: 3 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ opts.Add(BoolVariable("scu_build", "Use single compilation unit build", False))
opts.Add("scu_limit", "Max includes per SCU file when using scu_build (determines RAM use)", "0")
opts.Add(BoolVariable("engine_update_check", "Enable engine update checks in the Project Manager", True))
opts.Add(BoolVariable("steamapi", "Enable minimal SteamAPI integration for usage time tracking (editor only)", False))
opts.Add(BoolVariable("editor_pseudolocalization", "Enable editor pseudolocalization support", False))

# Thirdparty libraries
opts.Add(BoolVariable("builtin_brotli", "Use the built-in Brotli library", True))
Expand Down Expand Up @@ -986,6 +987,8 @@ if env["minizip"]:
env.Append(CPPDEFINES=["MINIZIP_ENABLED"])
if env["brotli"]:
env.Append(CPPDEFINES=["BROTLI_ENABLED"])
if env["editor_pseudolocalization"]:
env.Append(CPPDEFINES=["ENABLE_EDITOR_PSEUDOLOCALIZATION"])

if not env["verbose"]:
methods.no_verbose(env)
Expand Down
6 changes: 6 additions & 0 deletions core/string/translation_server.compat.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@

#ifndef DISABLE_DEPRECATED

String TranslationServer::_get_tool_locale_bind_compat_96105() {
return get_tool_locale();
}

void TranslationServer::_bind_compatibility_methods() {
ClassDB::bind_compatibility_method(D_METHOD("translate", "message", "context"), &TranslationServer::translate, DEFVAL(""));
ClassDB::bind_compatibility_method(D_METHOD("translate_plural", "message", "plural_message", "n", "context"), &TranslationServer::translate_plural, DEFVAL(""));

ClassDB::bind_compatibility_method(D_METHOD("get_tool_locale"), &TranslationServer::_get_tool_locale_bind_compat_96105);
}

#endif
Loading

0 comments on commit 0ea6685

Please sign in to comment.