Better to return default op context when we can't find a given operator (e.g. console...
authorBastien Montagne <montagne29@wanadoo.fr>
Sat, 9 Feb 2013 18:47:40 +0000 (18:47 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Sat, 9 Feb 2013 18:47:40 +0000 (18:47 +0000)
release/scripts/modules/bl_i18n_utils/bl_process_msg.py

index 6307ca2..bd5dd09 100644 (file)
@@ -396,7 +396,10 @@ def dump_py_messages_from_files(messages, check_ctxt, files):
         try:
             return op.get_rna().bl_rna.translation_context
         except Exception as e:
+            default_op_context = bpy.app.translations.contexts.operator_default
             print("ERROR: ", str(e))
+            print("       Assuming default operator context '{}'".format(default_op_context))
+            return default_op_context
 
     # -------------------------------------------------------------------------
     # Gather function names