Hello,

while merging some translation updates to the release branch I noticed that 
po-merge.py doesn't count strings marked as fuzzy.

[[[
make po-merge.py count fuzzy strings

* tools/dev/po-merge.py
  (main): count and print number of fuzzy strings
]]]

With kind regards,
Andreas Stieger

Index: tools/dev/po-merge.py
===================================================================
--- tools/dev/po-merge.py	(revision 1497603)
+++ tools/dev/po-merge.py	(working copy)
@@ -146,6 +146,7 @@ def main(argv):
     string_count = 0
     update_count = 0
     untranslated = 0
+    fuzzy = 0
     while True:
         comments, msgid, msgid_plural, msgstr = parse_translation(infile)
         if not comments and msgid is None:
@@ -180,11 +181,15 @@ def main(argv):
         for m in msgstr:
             if m == '""':
                 untranslated += 1
+        for c in comments:
+            if c.startswith('#,') and 'fuzzy' in c:
+                fuzzy += 1
 
     # We're done.  Tell the user what we did.
     print(('%d strings updated. '
+          '%d fuzzy strings. ' 
           '%d of %d strings are still untranslated (%.0f%%).' %
-          (update_count, untranslated, string_count,
+          (update_count, fuzzy, untranslated, string_count,
            100.0 * untranslated / string_count)))
 
 if __name__ == '__main__':

Reply via email to