summaryrefslogtreecommitdiffstats
path: root/core/translation.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-18 18:34:36 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-20 08:48:11 +0100
commit4857648a16585bbd0fb2fbc33d3d0f768b8223b5 (patch)
treef078268dfb7b6f2f417de9e272e7bf48e08ebcd8 /core/translation.h
parentb0aecb466dbc8a8c67f8aefb8277447f7603e9a5 (diff)
downloadredot-engine-4857648a16585bbd0fb2fbc33d3d0f768b8223b5.tar.gz
i18n: Add support for translating the class reference
- Parse `.po` files from `doc/translations/*.po` like already done with `editor/translations/*.po`. - Add logic to register a doc translation mapping in `TranslationServer` and `EditorSettings`. - Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`). Strings are automatically dedented and stripped of whitespace to ensure that they would match the translation catalog. - Use `DTR()` to translate relevant strings in `EditorHelp`, `EditorInspector`, `CreateDialog`, `ConnectionsDialog`. - Small simplification to `TranslationLoaderPO`, the path argument was not really meaningful.
Diffstat (limited to 'core/translation.h')
-rw-r--r--core/translation.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/translation.h b/core/translation.h
index b9e07fa2b1..29a068f450 100644
--- a/core/translation.h
+++ b/core/translation.h
@@ -73,6 +73,7 @@ class TranslationServer : public Object {
Set<Ref<Translation>> translations;
Ref<Translation> tool_translation;
+ Ref<Translation> doc_translation;
Map<String, String> locale_name_map;
@@ -109,6 +110,8 @@ public:
void set_tool_translation(const Ref<Translation> &p_translation);
StringName tool_translate(const StringName &p_message) const;
+ void set_doc_translation(const Ref<Translation> &p_translation);
+ StringName doc_translate(const StringName &p_message) const;
void setup();