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>2011-11-09 18:13:17 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-09 18:13:17 +0400
commite4269043b492d2fb3ae1b751148d327ff59a26c9 (patch)
treed00688c4bdf64308cdba45fc56640df6ed5532a5 /source/blender/blenfont/intern
parentee1569b9330a231d8781045853f5f794518de492 (diff)
Moving i18n code to BLF_translation.h
This way, we will be able to use it in non-UI parts of the code too.
Diffstat (limited to 'source/blender/blenfont/intern')
-rw-r--r--source/blender/blenfont/intern/blf_translation.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index 917d95cfc20..8688249732f 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -44,6 +44,8 @@
#include "BLF_translation.h"
+#include "DNA_userdef_types.h" /* For user settings. */
+
#ifdef WITH_INTERNATIONAL
const char unifont_filename[]="droidsans.ttf.gz";
static unsigned char *unifont_ttf= NULL;
@@ -88,3 +90,46 @@ const char* BLF_gettext(const char *msgid)
return msgid;
#endif
}
+
+int BLF_translate_iface(void)
+{
+#ifdef WITH_INTERNATIONAL
+ return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
+#else
+ return 0;
+#endif
+}
+
+int BLF_translate_tooltips(void)
+{
+#ifdef WITH_INTERNATIONAL
+ return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
+#else
+ return 0;
+#endif
+}
+
+const char *BLF_translate_do_iface(const char *msgid)
+{
+#ifdef WITH_INTERNATIONAL
+ if(BLF_translate_iface())
+ return BLF_gettext(msgid);
+ else
+ return msgid;
+#else
+ return msgid;
+#endif
+}
+
+const char *BLF_translate_do_tooltip(const char *msgid)
+{
+#ifdef WITH_INTERNATIONAL
+ if(BLF_translate_tooltips())
+ return BLF_gettext(msgid);
+ else
+ return msgid;
+#else
+ return msgid;
+#endif
+}
+