diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-02-13 15:52:01 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-02-13 15:52:01 +0400 |
commit | 43f4f807d986f0c50a336d73b10ebcb243b142a8 (patch) | |
tree | cd82ac3b02e385122e64ffa73c391a99a6528e61 /source/blender/blenfont/BLF_translation.h | |
parent | 4061f96d94aa410dd8550bb6b3ed8f6f87beb5de (diff) |
Fix physics' name not translated in main physics panel (reported on bf-translations ML).
This also revealed another bug, as you could not explicitely set default context to text_ctxt UI func parameter (None is not accpeted by RNA string props), so I had to change default context from py POV to "*" instead of None.
Anyway, that physics UI translation remains weak, as the trick used here (helper func) prevents message extractor script to directly find them. Currently it works because specified labels are also defined elsewhere, but it would be nice to have some kind of "translation markers" in py code too (similar to our N_/CTX_N_ C macros, unfortunately python does not have preprocessing ;) )...
Diffstat (limited to 'source/blender/blenfont/BLF_translation.h')
-rw-r--r-- | source/blender/blenfont/BLF_translation.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h index 35ca5f19bdc..fd8b30d1d1b 100644 --- a/source/blender/blenfont/BLF_translation.h +++ b/source/blender/blenfont/BLF_translation.h @@ -112,9 +112,13 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid); /* Default, void context. * WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level! + * NOTE: We translate BLF_I18NCONTEXT_DEFAULT as BLF_I18NCONTEXT_DEFAULT_BPY in Python, as we can’t use "natural" + * None value in rna string properties... :/ + * For perf reason, we only use the first char to detect this context, so other contexts should never start + * with the same char! */ -#define BLF_I18NCONTEXT_DEFAULT NULL /* Translated as None in Python. */ -#define BLF_I18NCONTEXT_DEFAULT_BPY_INTERN "" /* Only used in code, never exposed to user! */ +#define BLF_I18NCONTEXT_DEFAULT NULL +#define BLF_I18NCONTEXT_DEFAULT_BPY "*" /* Default context for operator names/labels. */ #define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator" @@ -165,7 +169,8 @@ typedef struct #define BLF_I18NCONTEXTS_ITEM(ctxt_id, py_id) {#ctxt_id, py_id, ctxt_id} #define BLF_I18NCONTEXTS_DESC { \ - BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT, "default"), \ + BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT, "default_real"), \ + BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT_BPY, "default"), \ BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "operator_default"), \ BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ACTION, "id_action"), \ BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ARMATURE, "id_armature"), \ |