tags 476348 + patch
thanks

The upstream bug has a patch since 2008, I checked it and fixed a
minor error (and "ported" it to the version in Debian, i.e. moved it
to the now right file). For your convenience, the updated patch is
attached.

It would be great if you could include it in your next update, it
eases translation and translation review quite a bit!

-- 
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/
--- __init__.py.orig	2010-12-13 17:14:07.000000000 +0100
+++ __init__.py	2011-08-13 16:47:56.000000000 +0200
@@ -25,6 +25,7 @@
 import tempfile
 import gettext
 import libxml2
+import textwrap
 
 NULL_STRING = '/dev/null'
 if not os.path.exists('/dev/null'): NULL_STRING = 'NUL'
@@ -67,6 +68,9 @@
         self.do_translations = False
         self.output_msgstr = False # this is msgid mode for outputMessage; True is for msgstr mode
 
+        self.numtags = 0
+        self.wrapper = textwrap.TextWrapper(initial_indent='"', subsequent_indent='"', break_long_words=False, expand_tabs=False, replace_whitespace=False)
+
     def translationsFollow(self):
         """Indicate that what follows are translations."""
         self.output_msgstr = True
@@ -125,16 +129,29 @@
             for reference in self.linenos[k]:
                 references += "%s:%d(%s) " % (reference[0], reference[2], reference[1])
             out.write("#: %s\n" % (references.strip()))
-            if k in self.nowrap and self.nowrap[k]:
+	    nowrap = k in self.nowrap and self.nowrap[k]
+	    if nowrap:
                 out.write("#, no-wrap\n")
-            out.write("msgid \"%s\"\n" % (k))
+            if not nowrap and len(k) > 65:
+                out.write("msgid \"\"\n")
+                out.write(" \"\n".join(self.wrapper.wrap(k)) )
+                out.write(" \"\n")
+            else:
+                out.write("msgid \"%s\"\n" % (k))
+
             translation = ""
             if self.do_translations:
                 if len(self.translations)>0:
                     translation = self.translations.pop(0)
             if translation == k:
                 translation = ""
-            out.write("msgstr \"%s\"\n\n" % (translation))
+            if not nowrap and len(translation) > 65:
+                out.write("msgstr \"\"\n")
+                out.write(" \"\n".join(self.wrapper.wrap(translation)) )
+                out.write(" \"\n")
+            else:
+                out.write("msgstr \"%s\"\n\n" % (translation))
+
 
 class XMLDocument(object):
     def __init__(self, filename, app):

Attachment: signature.asc
Description: Digital signature

Reply via email to