[Bf-blender-cvs] [46a7b46] master: Fix broken i18n messages extracting script with new py code.

Bastien Montagne noreply at git.blender.org
Thu Jan 14 17:00:28 CET 2016


Commit: 46a7b46c303f0217069a26db16974b4f637604e5
Author: Bastien Montagne
Date:   Thu Jan 14 16:00:15 2016 +0100
Branches: master
https://developer.blender.org/rB46a7b46c303f0217069a26db16974b4f637604e5

Fix broken i18n messages extracting script with new py code.

Some py devs are way too smart for our own good... :P

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

M	release/scripts/modules/bl_i18n_utils/bl_extract_messages.py

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

diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index baa9140..ce09b15 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -493,7 +493,11 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
         return i18n_contexts.default
 
     def _op_to_ctxt(node):
-        opname, _ = extract_strings(node)
+        # Some smart coders like things like:
+        #    >>> row.operator("wm.addon_disable" if is_enabled else "wm.addon_enable", ...)
+        # We only take first arg into account here!
+        bag = extract_strings_split(node)
+        opname, _ = bag[0]
         if not opname:
             return i18n_contexts.default
         op = bpy.ops




More information about the Bf-blender-cvs mailing list