Fix broken i18n messages extracting script with new py code.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 14 Jan 2016 15:00:15 +0000 (16:00 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 14 Jan 2016 16:00:16 +0000 (17:00 +0100)
Some py devs are way too smart for our own good... :P

release/scripts/modules/bl_i18n_utils/bl_extract_messages.py

index baa9140aaef48e94a3e1176ce6cf8a5a083aea41..ce09b156d85f40139eb2e6fc971dfff0ad1deb33 100644 (file)
@@ -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