i18n: replace some bit checks from U.transopts with utility functions UI_translate*

This commit is contained in:
Sergey Sharybin 2011-09-20 07:47:27 +00:00
parent 6d125e159d
commit e49e403953
3 changed files with 11 additions and 3 deletions

@ -96,12 +96,20 @@ static void ui_free_but(const bContext *C, uiBut *but);
int UI_translate_iface(void)
{
#ifdef INTERNATIONAL
return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_IFACE);
#else
return 0;
#endif
}
int UI_translate_tooltips(void)
{
#ifdef INTERNATIONAL
return (U.transopts & USER_DOTRANSLATE) && (U.transopts & USER_TR_TOOLTIPS);
#else
return 0;
#endif
}
const char *UI_translate_do_iface(const char *msgid)

@ -470,7 +470,7 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C)
}
}
#define TIP_(msgid) (((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_TOOLTIPS))?BLF_gettext(msgid):(msgid))
#define TIP_(msgid) UI_translate_do_tooltip(msgid)
void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
{
bScreen *screen= CTX_wm_screen(C);

@ -415,8 +415,8 @@ const char * BIF_menustringTransformOrientation(const bContext *C, const char *t
TransformOrientation *ts;
int i = V3D_MANIP_CUSTOM;
char *str_menu, *p;
if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) {
if(UI_translate_iface()) {
title= BLF_gettext(title);
menu= BLF_gettext(menu);
}