Re: i18ndude: wrap long lines

Maurits van Rees <m.van.rees-1kr/[email protected]> Wed, 11 Sep 2013 22:32:24 +0200
Newsgroups gmane.comp.web.zope.plone.internationalization
Organization Zest Software
Message-ID <[email protected]>
Thanks, Vincent.

I do notice that this change would make it harder to search for not yet =

translated msgstrs in a po file.  I normally search for 'msgstr ""' in =

my Emacs editor to find those, but with this change this would now also =

find all multi-line translations.  Trying it in p.a.locales master:

$ grep -c 'msgstr ""' fr/LC_MESSAGES/plone.po
3
$ i18ndude sync --pot plone.pot fr/LC_MESSAGES/plone.po
fr/LC_MESSAGES/plone.po: 0 added, 0 removed
$ grep -c 'msgstr ""' fr/LC_MESSAGES/plone.po
359

For example, this is the original:

#: CMFPlone/skins/plone_scripts/check_id.py:81
msgid "${name} is not a legal name. The following characters are =

invalid: ${characters}"
msgstr "${name} n'est pas un nom valide. Les caract=E8res suivants sont =

non valides : ${characters}"

and this would be the new contents:

#: CMFPlone/skins/plone_scripts/check_id.py:81
msgid ""
"${name} is not a legal name. The following characters are invalid: "
"${characters}"
msgstr ""
"${name} n'est pas un nom valide. Les caract=E8res suivants sont non =

valides : "
"${characters}"

This is how it should be when you wrap those lines so this is good, but =

not being able to search well could be a downside.

I have not made a release yet.  Especially with the above in mind I =

would want to make the wrapping a command line option so it is easier to =

switch off.  And I intend to show a bit more information on the PyPI page.

Best,

Maurits


Op 07-09-13 16:39, Vincent Fretin schreef:
> Hi Maurits,
>
> The change is ok for me.. You are now owner on pypi.
>
> Vincent Fretin
> Ecreall
> http://www.ecreall.com
>
>
> On Sat, Sep 7, 2013 at 4:29 PM, Maurits van Rees
> <m.van.rees-1kr/[email protected]
> <mailto:m.van.rees-1kr/[email protected]>> wrote:
>
>     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=3D0 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 readi=
ng
>     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 rea=
lly
>     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 ti=
me
>     i18ndude is called it will shift some words to other lines, giving mo=
re
>     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 transife=
x.
>         [do3cc]
>
>
>     Could I get release rights on pypi and plone.org <http://plone.org>?
>       My username is
>     maurits in both cases.  PyPI owners are: hannosch, nouri, vincentfret=
in.
>        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-st=
ep
>     tutorial videos with LearnDevNow. Subscribe today and save!
>     http://pubads.g.doubleclick.net/gampad/clk?id=3D58041391&iu=3D/4140/o=
stg.clktrk
>     _______________________________________________
>     Plone-i18n mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/plone-i18n
>
>
>
>
> -------------------------------------------------------------------------=
-----
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologi=
es
> 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=3D58041391&iu=3D/4140/ostg.=
clktrk
>
>
>
> _______________________________________________
> Plone-i18n mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/plone-i18n
>


-- =

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


---------------------------------------------------------------------------=
---
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=3D51271111&iu=3D/4140/ostg.cl=
ktrk