diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-18 22:25:48 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-12-18 22:25:48 +0400 |
commit | edf826d9240a1e153329e133f98d6a7243aa0c48 (patch) | |
tree | 8e354c9f81321462028499991041750beb221bb2 /source/blender/editors/interface/interface_layout.c | |
parent | 7e56e5ac949155e93f5defba8be30b272745b503 (diff) |
Various minor fixes to i18n code (mostly, translation of enum items' tooltips was wrongly bound to iface option, not tooltips one, and recent changes in r53119 were incorectly using BLF_pgettext, made them simpler by using CTX_IFACE_ macro).
Also fixed CTX_FOO_ macros when building without i18n, those were kinda wrong.
And hid i18n ui section in userpreferences when built without its support too.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9edeee7ee2e..a15256bc86f 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -720,9 +720,7 @@ static const char *ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, Prope RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, &totitem, &free); if (RNA_enum_name(item, retval, &name)) { -#ifdef WITH_INTERNATIONAL - name = BLF_pgettext(RNA_property_translation_context(prop), name); -#endif + name = CTX_IFACE_(RNA_property_translation_context(prop), name); } else { name = ""; @@ -909,7 +907,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char UI_OPERATOR_ERROR_RET(ot, opname, return ); WM_operator_properties_create_ptr(&ptr, ot); - + /* enum lookup */ if ((prop = RNA_struct_find_property(&ptr, propname))) { /* no need for translations here */ @@ -930,9 +928,9 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char RNA_warning("%s.%s not found", RNA_struct_identifier(ptr.type), propname); return; } - + RNA_property_enum_set(&ptr, prop, value); - + /* same as uiItemEnumO */ if (!name) name = ui_menu_enumpropname(layout, &ptr, prop, value); @@ -1191,11 +1189,8 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr for (a = 0; item[a].identifier; a++) { if (item[a].value == ivalue) { - const char *item_name = item[a].name; + const char *item_name = CTX_IFACE_(RNA_property_translation_context(prop), item[a].name); -#ifdef WITH_INTERNATIONAL - item_name = BLF_pgettext(RNA_property_translation_context(prop), item_name); -#endif uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name ? item_name : name, icon ? icon : item[a].icon); break; } |