Issue #7 resolved

does not wrap msgid and msgstr

Wagner Bruna
created an issue

Wrapping msgids and msgstrings doesn't seem to be working:

{{{

!python

import polib print 'version', polib.version wrapwidth = 20 print 'wrapwidth is', wrapwidth msg = 'a message that should be wrapped' print 'msgid length is', len(msg) trn = 'a translation that should be wrapped' print 'msgstr length is', len(trn) po = polib.POFile(wrapwidth=wrapwidth) po.append(polib.POEntry(msgid=msg, msgstr=trn)) print 'po file:' print str(po)

}}}

The output is:

{{{ version 0.5.2 wrapwidth is 20 msgid length is 32 msgstr length is 36 po file:

msgid "" msgstr ""

msgid "a message that should be wrapped" msgstr "a translation that should be wrapped"

}}}

Comments (6)

  1. David Jean Louis repo owner

    Hi Wagner,

    this is a known issue. Unfortunally, the textwrap python module seems to have issues with whitespace (at least someone reported this) and the code for wrapping msgid/msgstr was removed. I'd be in favor to put it back again, but it will require many unit tests.

    I'm busy at the moment and this is a low priority thing, so if you want, feel free to work on the feature if you can.

    Best regards,

    -- David

  2. Log in to comment