diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-22 22:25:59 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-12-22 22:25:59 +0400 |
commit | 39fd8fa4002391b24d6154ba5489cf1a5a05f5bd (patch) | |
tree | 12d3fe29e26039d0303dec1bd04c5d9e64143d7f /source/blender/makesrna/RNA_define.h | |
parent | e06a0ba2bb22814392848d0cc7e9f00764e81fce (diff) |
Translation context for RNA properties
This commit implements a way to define context of property which is used by
localization stuff and which is needed to resolve translation context when
some word wit the same english spelling is used in different meanings
(like Manual in meaning of tutorial, and Manual in meaning of something is
setting up by hand).
To define property's context there's a function RNA_def_property_translation_context.
If property doesn't have context, regular BLF_gettext function is used to get
translation of property name, otherwise BLF_pgettext is used for this.
Hence, for correct translation, messages in .po files should be marked
by "msgctxt" context, otherwise property with context declared wouldn't
be translated at all. Toolchain scripts from bf-translation project
would be updated soon.
If context for some values of enumerator property, property itself should
be moved to other context and all items from this enum would be moved to
this context automatically (it's impossible to move one few items to
another context).
P.S. Think context like "BRUSH" or "MODIFIER" are preferable than "NOUN" and "VERB"
because in some cases the same english noun used in different areas better be
translated differently to make translation more native.
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 8e8dd559fb1..4fb08227fb6 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -175,6 +175,8 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con void RNA_def_property_srna(PropertyRNA *prop, const char *type); void RNA_def_py_data(PropertyRNA *prop, void *py_data); +void RNA_def_property_translation_context(PropertyRNA *prop, const char *context); + /* Function */ FunctionRNA *RNA_def_function(StructRNA *srna, const char *identifier, const char *call); |