From 310c0b9f100bbaf0c51888808fcb9fbf11ea27f9 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 14 Apr 2012 15:06:41 +0000 Subject: Fixed another bunch of i18n bugs (thx to Leon Cheung for spotting them), among which: * Drag'n'drop translation in Outliner * "Execute" button in file window * "Labels" of spacing elements, in multi-column enums * A glitch with nodes "Value to RGB", they where called "ColorRamp" in node_type_base() call. This is not definitive, though, as it appears that UI node names are determined by this call, while it should be by "defines" in rna_nodetrre_types.h, I guess... Anyway, not good to have such things in two different places! Also moved default context name under BLF_translation.h, much better to have those all in one place, accessible from whole Blender code! --- source/blender/blenfont/BLF_translation.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/blenfont') diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h index 5e2fee36af0..2c786f87521 100644 --- a/source/blender/blenfont/BLF_translation.h +++ b/source/blender/blenfont/BLF_translation.h @@ -67,6 +67,7 @@ const char *BLF_translate_do_tooltip(const char *contex, const char *msgid); /* The "translation-marker" macro. */ #define N_(msgid) msgid +#define CTX_N_(context, msgid) msgid /* Those macros should be used everywhere in UI code. */ #ifdef WITH_INTERNATIONAL /* #define _(msgid) BLF_gettext(msgid) */ @@ -82,4 +83,18 @@ const char *BLF_translate_do_tooltip(const char *contex, const char *msgid); #define CTX_TIP_(context, msgid) msgid #endif +/****************************************************************************** + * All i18n contexts must be defined here. + * This is a nice way to be sure not to use a context twice for different + * things, and limit the number of existing contexts! + */ + +/* Default, void context. Just in case... */ +#define BLF_I18NCONTEXT_DEFAULT "" + +/* Default context for operator names/labels. */ +#define BLF_I18NCONTEXT_OPERATOR_DEFAULT "Operator" + + + #endif /* __BLF_TRANSLATION_H__ */ -- cgit v1.2.3