[Bf-blender-cvs] [d971c57] master: Fix root of the issue of bad_cast bug in localization

Sergey Sharybin noreply at git.blender.org
Thu Feb 27 10:07:31 CET 2014


Commit: d971c5785e0806ef3a49185b4e76a8d10e1a5bd0
Author: Sergey Sharybin
Date:   Thu Feb 27 15:06:05 2014 +0600
https://developer.blender.org/rBd971c5785e0806ef3a49185b4e76a8d10e1a5bd0

Fix root of the issue of bad_cast bug in localization

No need to call l10n stuff when it's disabled in the preferences.

Reviewed by @mont29, thanks!

===================================================================

M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 4bb04b7..86ef2f1 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -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;




More information about the Bf-blender-cvs mailing list