Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-01-21 14:52:34 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-21 14:52:34 +0400
commit3aa499f3f7ab750d8f0f647f8976a02967c7b040 (patch)
tree6137e31f2dc14958f23244ff654b85be7aa7275e /source/blender/blenfont/BLF_translation.h
parent22b5f097d2fbfbd3ce815bfef57d11e08fd67102 (diff)
I18n fix: "" context is not the same as NULL context!
This bug did not appear earlier because the "" default context was actually never used, always NULL context was passed instead. But bpy.app.translations uses "" as default context in its keys (simplifies the hash/comp functions of internal py messages cache)... So now, Blender prefers NULL (None in python) as default context value, but understands also "" as such.
Diffstat (limited to 'source/blender/blenfont/BLF_translation.h')
-rw-r--r--source/blender/blenfont/BLF_translation.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index b90b5c60a36..35ca5f19bdc 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -50,7 +50,7 @@ void BLF_lang_free(void);
/* Set the current locale. */
void BLF_lang_set(const char *);
-/* Get the current locale (short code, e.g. es_ES). */
+/* Get the current locale ([partial] ISO code, e.g. es_ES). */
const char *BLF_lang_get(void);
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g. if there is no variant,
@@ -110,8 +110,11 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
* things, and limit the number of existing contexts!
*/
-/* Default, void context. Just in case... */
-#define BLF_I18NCONTEXT_DEFAULT ""
+/* Default, void context.
+ * WARNING! The "" context is not the same as no (NULL) context at mo/boost::locale level!
+ */
+#define BLF_I18NCONTEXT_DEFAULT NULL /* Translated as None in Python. */
+#define BLF_I18NCONTEXT_DEFAULT_BPY_INTERN "" /* Only used in code, never exposed to user! */
/* Default context for operator names/labels. */
#define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator"