Re: i18ndude: wrap long lines
Vincent Fretin <[email protected]> Thu, 12 Sep 2013 10:35:24 +0200
| Newsgroups | gmane.comp.web.zope.plone.internationalization |
|---|---|
| Message-ID | <CAD=kyd-kLYiP1O5-qMBpiSp=5WuZYbdcAOoMMA8dkRG1UG4j1Q@mail.gmail.com> |
--===============0251672637723632360== Content-Type: multipart/alternative; boundary=089e0149bc1cb9493004e62b9f33 --089e0149bc1cb9493004e62b9f33 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Emacs can have a po mode, a quick search give me http://www.emacswiki.org/emacs/PoMode I use poedit. Vincent On Wed, Sep 11, 2013 at 10:32 PM, Maurits van Rees < m.van.rees-1kr/[email protected]> wrote: > 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 msgid= s > 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 settin= g > 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 > reading > > sys.argv in all the commands.) > > > > > > Question: does anyone foresee problems with this change for the cor= e > > 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 perfect= ly > > (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 <http://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=3D58041391&iu=3D/4140/ostg.= 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 > 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=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.= clktrk > _______________________________________________ > Plone-i18n mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/plone-i18n > --089e0149bc1cb9493004e62b9f33 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><div>Hi,<br><br></div>Emacs can have a po mode, a qui= ck search give me<br><a href=3D"http://www.emacswiki.org/emacs/PoMode">http= ://www.emacswiki.org/emacs/PoMode</a><br><br></div>I use poedit.<br><div><d= iv> <div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr">Vin= cent</div></div> <br><br><div class=3D"gmail_quote">On Wed, Sep 11, 2013 at 10:32 PM, Maurit= s van Rees <span dir=3D"ltr"><<a href=3D"mailto:m.van.rees@zestsoftware.= nl" target=3D"_blank">m.van.rees-1kr/[email protected]</a>></span> wrote:<br><= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex"> Thanks, Vincent.<br> <br> I do notice that this change would make it harder to search for not yet<br> translated msgstrs in a po file. =A0I normally search for 'msgstr "= ;"' in<br> my Emacs editor to find those, but with this change this would now also<br> find all multi-line translations. =A0Trying it in p.a.locales master:<br> <br> $ grep -c 'msgstr ""' fr/LC_MESSAGES/plone.po<br> 3<br> $ i18ndude sync --pot plone.pot fr/LC_MESSAGES/plone.po<br> fr/LC_MESSAGES/plone.po: 0 added, 0 removed<br> $ grep -c 'msgstr ""' fr/LC_MESSAGES/plone.po<br> 359<br> <br> For example, this is the original:<br> <br> #: CMFPlone/skins/plone_scripts/check_id.py:81<br> msgid "${name} is not a legal name. The following characters are<br> invalid: ${characters}"<br> msgstr "${name} n'est pas un nom valide. Les caract=E8res suivants= sont<br> non valides : ${characters}"<br> <br> and this would be the new contents:<br> <br> #: CMFPlone/skins/plone_scripts/check_id.py:81<br> msgid ""<br> "${name} is not a legal name. The following characters are invalid: &q= uot;<br> "${characters}"<br> msgstr ""<br> "${name} n'est pas un nom valide. Les caract=E8res suivants sont n= on<br> valides : "<br> "${characters}"<br> <br> This is how it should be when you wrap those lines so this is good, but<br> not being able to search well could be a downside.<br> <br> I have not made a release yet. =A0Especially with the above in mind I<br> would want to make the wrapping a command line option so it is easier to<br= > switch off. =A0And I intend to show a bit more information on the PyPI page= .<br> <br> Best,<br> <br> Maurits<br> <br> <br> Op 07-09-13 16:39, Vincent Fretin schreef:<br> > Hi Maurits,<br> ><br> > The change is ok for me.. You are now owner on pypi.<br> <div class=3D"im">><br> > Vincent Fretin<br> > Ecreall<br> > <a href=3D"http://www.ecreall.com" target=3D"_blank">http://www.ecreal= l.com</a><br> ><br> ><br> > On Sat, Sep 7, 2013 at 4:29 PM, Maurits van Rees<br> > <<a href=3D"mailto:m.van.rees-1kr/[email protected]">m.van.rees@zestsoftw= are.nl</a><br> </div><div><div class=3D"h5">> <mailto:<a href=3D"mailto:m.van.rees@z= estsoftware.nl">m.van.rees-1kr/[email protected]</a>>> wrote:<br> ><br> > =A0 =A0 Hi,<br> ><br> > =A0 =A0 I have committed changes for i18ndude that wrap long lines in = msgids and<br> > =A0 =A0 msgstrs, as most PO editors do that. =A0See this issue:<br> > =A0 =A0 <a href=3D"https://github.com/collective/i18ndude/issues/3" ta= rget=3D"_blank">https://github.com/collective/i18ndude/issues/3</a><br> ><br> > =A0 =A0 You can switch this off to get the original behavior back by s= etting an<br> > =A0 =A0 environment variable when calling i18ndude:<br> ><br> > =A0 =A0 PO_MAX_WIDTH=3D0 i18ndude ...<br> ><br> > =A0 =A0 (This could be made a proper command line option, but it seems= best to<br> > =A0 =A0 first refactor the script to using argparse instead of directl= y reading<br> > =A0 =A0 sys.argv in all the commands.)<br> ><br> ><br> > =A0 =A0 Question: does anyone foresee problems with this change for th= e core<br> > =A0 =A0 Plone translations?<br> ><br> > =A0 =A0 Of course the first time this new version is used you would ge= t a really<br> > =A0 =A0 long diff. =A0After that it should be fine. =A0If a translator= keeps<br> > =A0 =A0 everything on one line or does not manually split the lines pe= rfectly<br> > =A0 =A0 (which is probably hard without a custom po editor), then the = next time<br> > =A0 =A0 i18ndude is called it will shift some words to other lines, gi= ving more<br> > =A0 =A0 line differences. =A0On the plus side, someone fixes a typo in= a long<br> > =A0 =A0 msgid or msgstr, this is easier to notice in a 80 character li= ne than in<br> > =A0 =A0 a 1000 character line.<br> ><br> ><br> > =A0 =A0 On another note, the current release 3.2.2 is almost three yea= rs old, so<br> > =A0 =A0 a new release would be good. =A0From the changelog since then:= <br> ><br> > =A0 =A0 - Wrap msgid and msgstr lines at 79 characters, as most PO edi= tors do<br> > =A0 =A0 =A0 =A0 that. =A0Set an environment variable ``PO_MAX_WIDTH`` = to choose a<br> > =A0 =A0 =A0 =A0 different length. =A0If this is two or less, we do no = wrapping,<br> > =A0 =A0 =A0 =A0 because all lines must be enclosed in quotes.<br> > =A0 =A0 <a href=3D"https://github.com/collective/i18ndude/issues/3" ta= rget=3D"_blank">https://github.com/collective/i18ndude/issues/3</a><br> > =A0 =A0 =A0 =A0 [maurits]<br> ><br> > =A0 =A0 - Return exit code 1 when the called function gives an error. = =A0This<br> > =A0 =A0 =A0 =A0 currently only has an effect when calling ``find-untra= nslated``.<br> > =A0 =A0 <a href=3D"https://github.com/collective/i18ndude/issues/1" ta= rget=3D"_blank">https://github.com/collective/i18ndude/issues/1</a><br> > =A0 =A0 =A0 =A0 [maurits]<br> ><br> > =A0 =A0 - Moved code to <a href=3D"https://github.com/collective/i18nd= ude" target=3D"_blank">https://github.com/collective/i18ndude</a><br> > =A0 =A0 =A0 =A0 [maurits]<br> ><br> > =A0 =A0 - Backslash escape added to msgid when it includes double quot= es.<br> > =A0 =A0 =A0 =A0 [taito]<br> ><br> > =A0 =A0 - Add trmerge command to merge po files. Custom tailored for t= ransifex.<br> > =A0 =A0 =A0 =A0 [do3cc]<br> ><br> ><br> </div></div>> =A0 =A0 Could I get release rights on pypi and <a href=3D"= http://plone.org" target=3D"_blank">plone.org</a> <<a href=3D"http://plo= ne.org" target=3D"_blank">http://plone.org</a>>?<br> <div class=3D"im">> =A0 =A0 =A0 My username is<br> > =A0 =A0 maurits in both cases. =A0PyPI owners are: hannosch, nouri, vi= ncentfretin.<br> > =A0 =A0 =A0 =A0Or make a release yourself at your convenience.<br> ><br> > =A0 =A0 Best,<br> ><br> > =A0 =A0 --<br> > =A0 =A0 Maurits van Rees: <a href=3D"http://maurits.vanrees.org/" targ= et=3D"_blank">http://maurits.vanrees.org/</a><br> > =A0 =A0 Zest Software: <a href=3D"http://zestsoftware.nl" target=3D"_b= lank">http://zestsoftware.nl</a><br> ><br> ><br> > =A0 =A0 --------------------------------------------------------------= ----------------<br> > =A0 =A0 Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 201= 2, more!<br> > =A0 =A0 Discover the easy way to master current and previous Microsoft= <br> > =A0 =A0 technologies<br> > =A0 =A0 and advance your career. Get an incredible 1,500+ hours of ste= p-by-step<br> > =A0 =A0 tutorial videos with LearnDevNow. Subscribe today and save!<br= > > =A0 =A0 <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D580= 41391&iu=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doublec= lick.net/gampad/clk?id=3D58041391&iu=3D/4140/ostg.clktrk</a><br> > =A0 =A0 _______________________________________________<br> > =A0 =A0 Plone-i18n mailing list<br> > =A0 =A0 <a href=3D"mailto:[email protected]">Plone-i18n= @lists.sourceforge.net</a><br> </div>> =A0 =A0 <mailto:<a href=3D"mailto:[email protected]= e.net">[email protected]</a>><br> > =A0 =A0 <a href=3D"https://lists.sourceforge.net/lists/listinfo/plone-= i18n" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/plone-= i18n</a><br> <div class=3D"im">><br> ><br> ><br> ><br> > ----------------------------------------------------------------------= --------<br> > Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!= <br> > Discover the easy way to master current and previous Microsoft technol= ogies<br> > and advance your career. Get an incredible 1,500+ hours of step-by-ste= p<br> > tutorial videos with LearnDevNow. Subscribe today and save!<br> > <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D58041391&am= p;iu=3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net= /gampad/clk?id=3D58041391&iu=3D/4140/ostg.clktrk</a><br> ><br> ><br> ><br> > _______________________________________________<br> > Plone-i18n mailing list<br> > <a href=3D"mailto:[email protected]">[email protected]= ourceforge.net</a><br> > <a href=3D"https://lists.sourceforge.net/lists/listinfo/plone-i18n" ta= rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/plone-i18n</a>= <br> ><br> <br> <br> --<br> Maurits van Rees: <a href=3D"http://maurits.vanrees.org/" target=3D"_blank"= >http://maurits.vanrees.org/</a><br> Zest Software: <a href=3D"http://zestsoftware.nl" target=3D"_blank">http://= zestsoftware.nl</a><br> <br> <br> ---------------------------------------------------------------------------= ---<br> </div>How ServiceNow helps IT people transform IT departments:<br> 1. Consolidate legacy IT systems to a single system of record for IT<br> 2. Standardize and globalize service processes across IT<br> 3. Implement zero-touch automation to replace manual, redundant tasks<br> <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D51271111&iu= =3D/4140/ostg.clktrk" target=3D"_blank">http://pubads.g.doubleclick.net/gam= pad/clk?id=3D51271111&iu=3D/4140/ostg.clktrk</a><br> <div class=3D""><div class=3D"h5">_________________________________________= ______<br> Plone-i18n mailing list<br> <a href=3D"mailto:[email protected]">[email protected]= forge.net</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/plone-i18n" target= =3D"_blank">https://lists.sourceforge.net/lists/listinfo/plone-i18n</a><br> </div></div></blockquote></div><br></div></div></div></div></div> --089e0149bc1cb9493004e62b9f33-- --===============0251672637723632360== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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=51271111&iu=/4140/ostg.clktrk --===============0251672637723632360== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Plone-i18n mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plone-i18n --===============0251672637723632360==--