Hi Xqt,
On 26 August 2011 03:12, info@gno.de wrote:
I've seen it during discussion with Nikerabbit on tw.net (look at the first LQ-threat according pywikipedia) and I am working on a pythonic version of the plural-gettext.txt. I am using lambda function for that like this one (for mk-wiki): plural = lambda n: 0 if (n == 1 or n%10 == 1) else 1 I think this is the easiest way.
Yes, this makes sense. Can TW output a formatted version? Anyway, I would suggest using the same dict-based format as the other translations, i.e.
{ 'en': lambda n: 0 if (n == 0 or n > 1) else 1, 'mk': lambda n: 0 if (n==1 or n%10=1) else 1, }
etc, which would make it easy to use in python. But you probably already thought of that :-)
But we have a remaining problem found on table2wiki. Now we have 3 messages.
One message is used if we have no warning, and we have two messages either for one or a lot of warnings. I guess we could keep the first "table2wiki-no-warning" message and merge the two messages "table2wiki-one-warning" and "table2wiki-warnings" using {{Plural:}} tag. It is also possible to use the first message every time and append the warning message if needed.
Yes, this makes sense. I would suggest using 'no edits' and 'there are n edits', which makes sense as a distinction. TW is dynamic enough to quickly translate merged messages, I guess.
anyway -- good luck implementing :-)
Best, Merlijn