From 4857648a16585bbd0fb2fbc33d3d0f768b8223b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 18 Mar 2020 18:34:36 +0100 Subject: 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. --- editor/SCsub | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'editor/SCsub') diff --git a/editor/SCsub b/editor/SCsub index 4431166ee6..e54383350e 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -66,10 +66,15 @@ if env['tools']: path = env.Dir('.').abspath - # Translations + # Editor translations tlist = glob.glob(path + "/translations/*.po") - env.Depends('#editor/translations.gen.h', tlist) - env.CommandNoCache('#editor/translations.gen.h', tlist, run_in_subprocess(editor_builders.make_translations_header)) + env.Depends('#editor/editor_translations.gen.h', tlist) + env.CommandNoCache('#editor/editor_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_editor_translations_header)) + + # Documentation translations + tlist = glob.glob(env.Dir("#doc").abspath + "/translations/*.po") + env.Depends('#editor/doc_translations.gen.h', tlist) + env.CommandNoCache('#editor/doc_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_doc_translations_header)) # Fonts flist = glob.glob(path + "/../thirdparty/fonts/*.ttf") -- cgit v1.2.3