diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-16 19:39:25 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-16 19:39:25 +0400 |
commit | 2caa507b7eaa7d55a0be7bda513f08ecfe4791f1 (patch) | |
tree | 86e65a98805030b6191643571c2eea1962da9ea7 /source/blender/makesrna/intern/rna_define.c | |
parent | 4e6669cee38ed81dc2e9be52f2900885295506f3 (diff) |
i18n stuff: adds translation_context to RNA structs (used for there ui name), and a first default "Operator" one for all operators' label.
The fact is, operators' label are nearly always verbs, while properties labels are nearly always nouns. So this should already solve many translations' problems regarding noun/verb confusion.
This commit also simplifies a bit i18n usage:
*Now IFACE_ and TIP_ macros (or there context versions, CTX_IFACE_/TIP_) are used nearly everywhere (with one exception, where code is a bit complex and needs to manually test whether ui/tip translations is allowed, so no need to redo it later through those macros).
*Also, those macros are now defined to NOP in case WITH_INTERNATIONAL is false, which avoid testing that define everywhere in code!
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 202418205f3..78780678af4 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -871,6 +871,11 @@ void RNA_def_struct_ui_icon(StructRNA *srna, int icon) srna->icon = icon; } +void RNA_def_struct_translation_context(StructRNA *srna, const char *context) +{ + srna->translation_context = context; +} + /* Property Definition */ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype) |