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-03-20 22:42:09 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-03-20 22:42:09 +0400
commit885441e75804a92d4c2270fd006f3e71fc460d7b (patch)
tree7d3e89d07af080a2146eb747ff9da6ecd9d0e7f9 /source/blender/blenfont/BLF_translation.h
parente9b0b402cc85533c8b247b174f17f41b1892ef04 (diff)
I18n users request: add the ability to use a translated name for newly added/created objects or other datablocks.
This simply adds a third "translation type" (in addition to iface and tip), "new data", with relevant user settings flag and helper funcs/macros (and py api). Currently implemented name translation when adding new objects, as well as modifiers and constraints, will add the others (cd layers, scenes, perhaps nodes [though I think they do not need this], etc.) later.
Diffstat (limited to 'source/blender/blenfont/BLF_translation.h')
-rw-r--r--source/blender/blenfont/BLF_translation.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 379978feca3..f59d3409b65 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -77,8 +77,10 @@ const char *BLF_pgettext(const char *msgctxt, const char *msgid);
/* translation */
bool BLF_translate_iface(void);
bool BLF_translate_tooltips(void);
+bool BLF_translate_new_dataname(void);
const char *BLF_translate_do_iface(const char *msgctxt, const char *msgid);
const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
+const char *BLF_translate_do_new_dataname(const char *msgctxt, const char *msgid);
/* The "translation-marker" macro. */
@@ -90,14 +92,18 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
/*# define _(msgid) BLF_gettext(msgid) */
# define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
# define TIP_(msgid) BLF_translate_do_tooltip(NULL, msgid)
+# define DATA_(msgid) BLF_translate_do_new_dataname(NULL, msgid)
# define CTX_IFACE_(context, msgid) BLF_translate_do_iface(context, msgid)
# define CTX_TIP_(context, msgid) BLF_translate_do_tooltip(context, msgid)
+# define CTX_DATA_(context, msgid) BLF_translate_do_new_dataname(context, msgid)
#else
/*# define _(msgid) msgid */
# define IFACE_(msgid) msgid
# define TIP_(msgid) msgid
+# define DATA_(msgid) msgid
# define CTX_IFACE_(context, msgid) msgid
# define CTX_TIP_(context, msgid) msgid
+# define CTX_DATA_(context, msgid) msgid
#endif
/* Helper macro, when we want to define a same msgid for multiple msgctxt...