i18ndude: wrap long lines

Maurits van Rees <m.van.rees-1kr/[email protected]> Sat, 07 Sep 2013 16:29:10 +0200
Newsgroups gmane.comp.web.zope.plone.internationalization
Organization Zest Software
Message-ID <[email protected]>
Hi,

I have committed changes for i18ndude that wrap long lines in msgids and 
msgstrs, as most PO editors do that.  See this issue:
https://github.com/collective/i18ndude/issues/3

You can switch this off to get the original behavior back by setting an 
environment variable when calling i18ndude:

PO_MAX_WIDTH=0 i18ndude ...

(This could be made a proper command line option, but it seems best to 
first refactor the script to using argparse instead of directly reading 
sys.argv in all the commands.)


Question: does anyone foresee problems with this change for the core 
Plone translations?

Of course the first time this new version is used you would get a really 
long diff.  After that it should be fine.  If a translator keeps 
everything on one line or does not manually split the lines perfectly 
(which is probably hard without a custom po editor), then the next time 
i18ndude is called it will shift some words to other lines, giving more 
line differences.  On the plus side, someone fixes a typo in a long 
msgid or msgstr, this is easier to notice in a 80 character line than in 
a 1000 character line.


On another note, the current release 3.2.2 is almost three years old, so 
a new release would be good.  From the changelog since then:

- Wrap msgid and msgstr lines at 79 characters, as most PO editors do
   that.  Set an environment variable ``PO_MAX_WIDTH`` to choose a
   different length.  If this is two or less, we do no wrapping,
   because all lines must be enclosed in quotes.
   https://github.com/collective/i18ndude/issues/3
   [maurits]

- Return exit code 1 when the called function gives an error.  This
   currently only has an effect when calling ``find-untranslated``.
   https://github.com/collective/i18ndude/issues/1
   [maurits]

- Moved code to https://github.com/collective/i18ndude
   [maurits]

- Backslash escape added to msgid when it includes double quotes.
   [taito]

- Add trmerge command to merge po files. Custom tailored for transifex.
   [do3cc]


Could I get release rights on pypi and plone.org?  My username is 
maurits in both cases.  PyPI owners are: hannosch, nouri, vincentfretin. 
  Or make a release yourself at your convenience.

Best,

-- 
Maurits van Rees: http://maurits.vanrees.org/
Zest Software: http://zestsoftware.nl


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk