[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60812] trunk/blender/release/scripts/ modules/bl_i18n_utils/utils.py: i18n utils: check not only that the number of printf markers are the same in msgid and msgstr , but also that they are of the same type and order.

Bastien Montagne montagne29 at wanadoo.fr
Thu Oct 17 08:52:27 CEST 2013


Revision: 60812
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60812
Author:   mont29
Date:     2013-10-17 06:52:26 +0000 (Thu, 17 Oct 2013)
Log Message:
-----------
i18n utils: check not only that the number of printf markers are the same in msgid and msgstr, but also that they are of the same type and order. Sorry, should have done that from the beginning... :/

This should prevent any bug like [#37095] Timeline crash when chose any keying set then press keyframe-insert, to appear again.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-10-17 06:40:35 UTC (rev 60811)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-10-17 06:52:26 UTC (rev 60812)
@@ -462,9 +462,10 @@
                 elif fix:
                     tmp[real_key] = msg
             done_keys.add(key)
-            if '%' in msgid and msgstr and len(_format(msgid)) != len(_format(msgstr)):
+            if '%' in msgid and msgstr and _format(msgid) != _format(msgstr):
                 if not msg.is_fuzzy:
-                    ret.append("Error! msg's format entities are not matched in msgid and msgstr ({})".format(real_key))
+                    ret.append("Error! msg's format entities are not matched in msgid and msgstr ({} / {})"
+                               "".format(real_key, msgstr))
                 if fix:
                     msg.msgstr = ""
         for k in rem:




More information about the Bf-blender-cvs mailing list