Fix root of the issue of bad_cast bug in localization
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 27 Feb 2014 09:06:05 +0000 (15:06 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 27 Feb 2014 09:07:25 +0000 (15:07 +0600)
No need to call l10n stuff when it's disabled in the preferences.

Reviewed by @mont29, thanks!

source/blender/makesrna/intern/rna_access.c

index 4bb04b792ef063dbbe6156e1c1998cadf891863e..86ef2f1b74fd4ab63577cbd75257e3d0c017b49d 100644 (file)
@@ -1444,7 +1444,11 @@ bool RNA_property_enum_name_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
        result = RNA_property_enum_name(C, ptr, prop, value, name);
 
        if (result) {
-               *name = BLF_pgettext(prop->translation_context, *name);
+               if (!(prop->flag & PROP_ENUM_NO_TRANSLATE)) {
+                       if (BLF_translate_iface()) {
+                               *name = BLF_pgettext(prop->translation_context, *name);
+                       }
+               }
        }
 
        return result;