Make --doctool locale aware

* Adds `indent(prefix)` to `String`
* Moves the loading of tool/doc translation into
  `editor/editor_translation.{h,cpp}`
* 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`.

(cherry picked from commit c11b1850c4)
This commit is contained in:
Haoyu Qiu
2021-12-16 18:22:44 +08:00
committed by Rémi Verschelde
parent f8b4412b51
commit b90bec546d
9 changed files with 223 additions and 64 deletions

View File

@@ -241,7 +241,7 @@
<method name="dedent">
<return type="String" />
<description>
Returns a copy of the string with indentation (leading tabs and spaces) removed.
Returns a copy of the string with indentation (leading tabs and spaces) removed. See also [method indent] to add indentation.
</description>
</method>
<method name="empty">
@@ -380,6 +380,15 @@
[/codeblock]
</description>
</method>
<method name="indent">
<return type="String" />
<argument index="0" name="prefix" type="String" />
<description>
Returns a copy of the string with lines indented with [code]prefix[/code].
For example, the string can be indented with two tabs using [code]"\t\t"[/code], or four spaces using [code]" "[/code]. The prefix can be any string so it can also be used to comment out strings with e.g. [code]"# "[/code]. See also [method dedent] to remove indentation.
[b]Note:[/b] Empty lines are kept empty.
</description>
</method>
<method name="insert">
<return type="String" />
<argument index="0" name="position" type="int" />