On Wed, 2007-11-21 at 12:23 -0300, Xavier Alvarez wrote: > Dwayne, > > The situation is a bit confusing because I'm not involved in the > length of the loop (meaning that the dangerous plural error > reported is something that happened to others, not me). > > The bottom line is that if I define a language (through the GUI): > # Icelandic > is.fullname = u'Icelandic' > is.nplurals = '2' > is.pluralequation = '(n != 1)' > > When I add the language to a project through the GUI, Pootle > generates the /is/ directory with all the PO files. Fine, but the > "Plural-forms" line in them is the one noted below -- iow, a non > valid line.
OK so 1) you have a correct plural definition in pootle.prefs 2) you have a project and initialise the files for translation 3) the files end up with a uninitalised plural header which causes an error when you actually use then in the downstream project. Can you please check the following for me: 1) Does the POT file contain a Plural-Form entry? I'm guessing that the problem is that the POT doesn't have or need plurals. That we then add a blank header when the files are initialised. We then edit in Pootle but it never updates the header as its not a plural file. If that is the case then the following commit from Friedel was probably designed to solve that problem: http://translate.svn.sourceforge.net/viewvc/translate?view=rev&revision=6723 > The unsafeness or dangerousness error reported downstream could > just be result of the invalid line, but the first issue is why > does Pootle generate it in the first place? > > > As a side issue, is there a 'central repository' for plural > formulas? I failed to find one. Improvising on this is something > I would like to avoid... We maintain: http://translate.sourceforge.net/wiki/l10n/pluralforms These should all be in the pootle.prefs file though. > > Cheers, > Xavier > > On Wednesday 21 November 2007 05:50, Dwayne Bailey wrote: > DB> Hi Xavier, > DB> > DB> You seem to be asking multiple questions here, I'll give some > DB> feedback and hopefully we can get to the root of the > DB> problem. > DB> > DB> On Tue, 2007-11-20 at 16:24 -0300, Xavier Alvarez wrote: > DB> > Hi, > DB> > > DB> > I'm being notified of the following error after noting that > DB> > the developers were doing plural handling by code instead > DB> > of gettext: > DB> > > DB> > > The error appears to originate in a common file to all > DB> > > these activities: "/usr/lib/python2.5/gettext.py" > DB> > > > DB> > > build error report in all modules is: > DB> > > > DB> > > File "/usr/lib/python2.5/gettext.py", line 93, in c2py > DB> > > > DB> > > raise ValueError, 'plural forms expression could be > DB> > > dangerous' > DB> > DB> We use the Python gettext.py when working with the Pootle > DB> server translations. That is for the translation of the > DB> Pootle interface, this is not used by any other projects > DB> that you host. We do this to allow Pootle to be translated > DB> live and thus we don't use gettext which requires .mo files. > DB> > DB> I haven't seen this error before. Did you add a plural > DB> equation for any of the languages that you are hosting or is > DB> this with a default setup? > DB> > DB> What language are you using when you access Pootle? Is this > DB> one that you added? > DB> > DB> > I'm assuming that some of the formulas in the POs are > DB> > invalid... which happens in many (all?) of the POs > DB> > initially generated by Pootle, even when a valid formula > DB> > has been declared for the language the result is: > DB> > > DB> > "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" > DB> > > DB> > Forcing an update from templates fails to rectify it. > DB> > DB> When you say generated are these files that you have > DB> initialised within Pootle? > DB> > DB> I saw a commit from Friedel to not add 'Plural-Forms' if the > DB> template has none. > DB> > DB> > Solutions? > DB> > DB> I need a better understanding of the problem. If you can > DB> help me replicate it then that would help. > DB> > -- Dwayne Bailey Translate.org.za +27-12-460-1095 (w) +27-83-443-7114 (cell) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Translate-pootle mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/translate-pootle
