diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-12-15 23:01:06 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-12-16 17:49:22 +0800 |
commit | e4e4e475f8f1a1d8b82ef7ad636da8536e8c6554 (patch) | |
tree | 584197a87c47a265d71a97df3fcd69d8e5a57783 /core/variant | |
parent | edd3ca45016a4ee8cc5f7c1108e1c71bfa2a86ab (diff) |
Make `--doctool` locale aware
* Adds `indent(str)` to `String`:
* Indent the (multiline) string with the given indentation.
* This method is added in order to keep the translated XML correctly
indented.
* Moves the loading of tool/doc translation into
`editor/editor_translation.{h,cpp}`.
* This will be used from both `EditorSettings` and the doc tool from
`main`.
* Makes use of doc translation when generating XML class references, and
setup the translation locale based on `-l LOCALE` CLI parameter.
The XML class reference won't be translated if `-l LOCALE` parameter is
not given, or when it's `-l en`.
Diffstat (limited to 'core/variant')
-rw-r--r-- | core/variant/variant_call.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 82f547e78c..51b9119933 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1411,6 +1411,7 @@ static void _register_variant_builtin_methods() { bind_method(String, get_basename, sarray(), varray()); bind_method(String, plus_file, sarray("file"), varray()); bind_method(String, unicode_at, sarray("at"), varray()); + bind_method(String, indent, sarray("prefix"), varray()); bind_method(String, dedent, sarray(), varray()); bind_method(String, hash, sarray(), varray()); bind_method(String, md5_text, sarray(), varray()); |