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 12:08:20 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-21 12:08:20 +0400
commit2b9ab8781d95609f529c2d5dcf770c82d23afe17 (patch)
tree2590a91787568ad539accff9a544c2240cd372fb /source/blender/blenfont/BLF_translation.h
parent40629671f468a59a8fd8d5fa5953a848d19a5d44 (diff)
Various cleanup in i18n code (having funcs implemented in two different places is tricky, you quickly forget to add/edit one, we already have this problem with ugly bplayer stub... e.g. since r53938, BLF_locale_explode was not implemented in non-WITH_INTERNATIONAL builds). Also tried to simplify #ifdef's here...
Diffstat (limited to 'source/blender/blenfont/BLF_translation.h')
-rw-r--r--source/blender/blenfont/BLF_translation.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index 7194c6c23c1..b90b5c60a36 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -33,6 +33,8 @@
#ifndef __BLF_TRANSLATION_H__
#define __BLF_TRANSLATION_H__
+#include "BLI_utildefines.h" /* for bool type */
+
#define TEXT_DOMAIN_NAME "blender"
/* blf_lang.c */
@@ -53,7 +55,8 @@ 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,
* *variant and *language_variant will always be NULL).
- * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
+ * Non-null elements are always MEM_mallocN'ed, it's the caller's responsibility to free them.
+ * NOTE: Always available, even in non-WITH_INTERNATIONAL builds.
*/
void BLF_locale_explode(const char *locale, char **language, char **country, char **variant,
char **language_country, char **language_variant);
@@ -63,16 +66,14 @@ struct EnumPropertyItem *BLF_RNA_lang_enum_properties(void);
/* blf_translation.c */
-#ifdef WITH_INTERNATIONAL
unsigned char *BLF_get_unifont(int *unifont_size);
void BLF_free_unifont(void);
-#endif
const char *BLF_pgettext(const char *msgctxt, const char *msgid);
/* translation */
-int BLF_translate_iface(void);
-int BLF_translate_tooltips(void);
+bool BLF_translate_iface(void);
+bool BLF_translate_tooltips(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);
@@ -83,17 +84,17 @@ const char *BLF_translate_do_tooltip(const char *msgctxt, const char *msgid);
/* Those macros should be used everywhere in UI code. */
#ifdef WITH_INTERNATIONAL
-/* #define _(msgid) BLF_gettext(msgid) */
- #define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
- #define TIP_(msgid) BLF_translate_do_tooltip(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 _(msgid) BLF_gettext(msgid) */
+# define IFACE_(msgid) BLF_translate_do_iface(NULL, msgid)
+# define TIP_(msgid) BLF_translate_do_tooltip(NULL, msgid)
+# define CTX_IFACE_(context, msgid) BLF_translate_do_iface(context, msgid)
+# define CTX_TIP_(context, msgid) BLF_translate_do_tooltip(context, msgid)
#else
-/* #define _(msgid) msgid */
- #define IFACE_(msgid) msgid
- #define TIP_(msgid) msgid
- #define CTX_IFACE_(context, msgid) msgid
- #define CTX_TIP_(context, msgid) msgid
+/*# define _(msgid) msgid */
+# define IFACE_(msgid) msgid
+# define TIP_(msgid) msgid
+# define CTX_IFACE_(context, msgid) msgid
+# define CTX_TIP_(context, msgid) msgid
#endif
/* Helper macro, when we want to define a same msgid for multiple msgctxt...
@@ -160,7 +161,7 @@ typedef struct
#define BLF_I18NCONTEXTS_ITEM(ctxt_id, py_id) {#ctxt_id, py_id, ctxt_id}
-#define BLF_I18NCONTEXTS_DESC { \
+#define BLF_I18NCONTEXTS_DESC { \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_DEFAULT, "default"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "operator_default"), \
BLF_I18NCONTEXTS_ITEM(BLF_I18NCONTEXT_ID_ACTION, "id_action"), \
@@ -198,6 +199,4 @@ typedef struct
{NULL, NULL, NULL} \
}
-//#undef _BLF_I18NCONTEXTS_ITEM
-
#endif /* __BLF_TRANSLATION_H__ */