subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongsh...@apache.org
Subject svn commit: r1222126 - /subversion/trunk/tools/dev/po-merge.py
Date Thu, 22 Dec 2011 09:33:51 GMT
Author: dongsheng
Date: Thu Dec 22 09:33:50 2011
New Revision: 1222126

URL: http://svn.apache.org/viewvc?rev=1222126&view=rev
Log:
When long msgid break to several lines, it still is the same msgid.

Obvious fix.

  * dev/po-merge.py: Merge msgid which break to several lines, and
    update comments.

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=1222126&r1=1222125&r2=1222126&view=diff
==============================================================================
--- subversion/trunk/tools/dev/po-merge.py (original)
+++ subversion/trunk/tools/dev/po-merge.py Thu Dec 22 09:33:50 2011
@@ -52,7 +52,7 @@ def parse_translation(f):
         line = f.readline()
         if line[0] != '"':
             break
-        msgid += '\n' + line[:-1]
+        msgid = msgid[:-1] + line[1:-1]
 
     # Parse optional msgid_plural
     msgid_plural = None
@@ -64,7 +64,7 @@ def parse_translation(f):
             line = f.readline()
             if line[0] != '"':
                 break
-            msgid_plural += '\n' + line[:-1]
+            msgid_plural = msgid_plural[:-1] + line[1:-1]
 
     # Parse msgstr
     msgstr = []
@@ -117,9 +117,9 @@ def main(argv):
         argv0 = os.path.basename(argv[0])
         sys.exit('Usage: %s <lang.po>\n'
                  '\n'
-                 'This script will replace the translations and flags in lang.po with\n'
-                 'the translations and flags in the source po file read from standard\n'
-                 'input.  Strings that are not found in the source file are left untouched.\n'
+                 'This script will replace the translations and flags in lang.po (LF line
endings)\n'
+                 'with the translations and flags in the source po file read from standard
input.\n'
+                 'Strings that are not found in the source file are left untouched.\n'
                  'A backup copy of lang.po is saved as lang.po.bak.\n'
                  '\n'
                  'Example:\n'



Mime
View raw message