You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by as...@apache.org on 2013/06/28 19:36:52 UTC

svn commit: r1497857 - /subversion/trunk/tools/dev/po-merge.py

Author: astieger
Date: Fri Jun 28 17:36:51 2013
New Revision: 1497857

URL: http://svn.apache.org/r1497857
Log:
make po-merge.py count fuzzy strings

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

Approved by: danielsh

Modified:
    subversion/trunk/tools/dev/po-merge.py

Modified: subversion/trunk/tools/dev/po-merge.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dev/po-merge.py?rev=1497857&r1=1497856&r2=1497857&view=diff
==============================================================================
--- subversion/trunk/tools/dev/po-merge.py (original)
+++ subversion/trunk/tools/dev/po-merge.py Fri Jun 28 17:36:51 2013
@@ -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.split(', '):
+                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__':