diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-19 23:37:22 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-19 23:37:22 +0400 |
commit | d39c6fdf2d7efbb3560038184f43f6bf882c5049 (patch) | |
tree | 2850fde8813f530a89094b675976ca94415b4166 /source/blender/blenfont/BLF_translation.h | |
parent | 5c48eb3bb9c42ba06f40d7b6d1c83b76d90d6a67 (diff) |
Various cleanup around default i18n context.
Issue is that the real default context is NULL, however, in python and RNA, this value can't be used easily. So we use a specific string instead ("*"), defined as BLF_I18NCONTEXT_DEFAULT_BPYRNA.
From now on, all bpy/rna code should only use the BLF_I18NCONTEXT_DEFAULT_BPYRNA value, while all "usual" C code should use the BLF_I18NCONTEXT_DEFAULT value (BLF_pgettext is still able to "understand" both, anyway).
Also added BLF_is_default_context helper func, so that we can keep that check in a single place!
Finally, we should no need anymore to understand the void string "" as default context too - two values for a same thing are more than enough!
Diffstat (limited to 'source/blender/blenfont/BLF_translation.h')
-rw-r--r-- | source/blender/blenfont/BLF_translation.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h index db449995b8f..379978feca3 100644 --- a/source/blender/blenfont/BLF_translation.h +++ b/source/blender/blenfont/BLF_translation.h @@ -71,6 +71,7 @@ void BLF_free_unifont(void); unsigned char *BLF_get_unifont_mono(int *unifont_size); void BLF_free_unifont_mono(void); +bool BLF_is_default_context(const char *msgctxt); const char *BLF_pgettext(const char *msgctxt, const char *msgid); /* translation */ @@ -101,7 +102,7 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid); /* Helper macro, when we want to define a same msgid for multiple msgctxt... * Does nothing in C, but is "parsed" by our i18n py tools. - * XXX Currently limited to at most 16 contexts at most + * XXX Currently limited to at most 16 contexts at once * (but you can call it several times with the same msgid, should you need more contexts!). */ #define BLF_I18N_MSGID_MULTI_CTXT(msgid, ...) @@ -122,7 +123,7 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid); * with the same char! */ #define BLF_I18NCONTEXT_DEFAULT NULL -#define BLF_I18NCONTEXT_DEFAULT_BPY "*" +#define BLF_I18NCONTEXT_DEFAULT_BPYRNA "*" /* Default context for operator names/labels. */ #define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator" @@ -174,7 +175,7 @@ typedef struct #define BLF_I18NCONTEXTS_DESC { \ BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT, "default_real"), \ - BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT_BPY, "default"), \ + BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT_BPYRNA, "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"), \ |