On Tue, Jan 23, 2018 at 1:48 PM, Yuri Chornoivan <[email protected]> wrote:

> вівторок, 23 січня 2018 р. 20:12:55 EET Paul Licameli написано:
> > Finally Ukrainian.  gettext documentation says this:
> >
> > "Three forms, special cases for numbers ending in 1 and 2, 3, 4, except
> > those ending in 1[1-4] The header entry would look like this:
> >
> > Plural-Forms: nplurals=3; \
> >     plural=n%10==1 && n%100!=11 ? 0 : \
> >            n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
> > Languages with this property include:
> >
> > Slavic family
> > Russian, Ukrainian, Belarusian, Serbian, Croatian"
> >
> > That expression means you map a number to a place in the msgstr[] table
> > thus: return 0 for 1, 21, 31, ...
> > return 1 for 2, 3, 4, 22, 23, 24, 32, 33, 34, ...
> > return 2 for 5 through 20, 25 through 30, 35 through 40, ...
> > (and similarly for each century)
> >
> > From what I know of Russian, the first case is where you use nominative
> > singular, the second genitive singular, the last, genitive plural.
> (Unless
> > the noun phrase as a whole is in an oblique case, not nominative.)
> >
> > Is it correct that Ukrainian has identical rules?  But uk.po has this
> > instead:
> >
> > "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 :
> n"
> >
> > In other words:
> > return 0 for 21, 31, ...
> > return 1 in no case
> > return 2 for 2
> > return 3 for 1 and 3
> > For all other numbers, return out-of-bounds!  This can't be right.
>
> Actually, it was read in a wrong way.
>
> Let's see. The whole header of the file from PR says:
>
> "Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n"
> "%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
>

Oh, I am a fool.  I just used grep and didn't look closer at the run-on
line.


>
> which means
>
> Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 :
> n%10>=2
> && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
>
> or in human readable form:
>
> 3rd form for n=1
> 0th form for (n div 10=1) and (n div 100 not equal 11) or simpler "21,
> 31..."
> 1st form for 2, 3, 4, 22, 23 , 24...
> 2nd form for 5, 6, 7, 8...
>

That is right.

And everything below makes sense to me too, and with my knowledge of
Russian.  (Some college courses long ago, but my fluency is much
deteriorated.)

PRL



>
> As you can see, it is the same as CLDR form for all cases, but the case
> n=1.
>
> You might be asking _why on Earth!!!?_  Can it be simpler?
>
> Heh... The standard form works only for the messages with a replacer.
>
> Consider the examples from gettext man (the same thing holds true for
> wxWidgets too):
>
> https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/
> html_node/Plural-forms.html
>
> 1.
>
> ngettext ("%d file removed", "%d files removed", n)
>
> Perfect. The standard form works just fine. %d is replaced by the number
> and
> all 3 standard forms fit.
>
> 2.
>
> ngettext ("One file removed", "%d files removed", n)
>
> Trouble. The form 0 for Slavic languages is for 1, 21, 31... But in words
> they
> are not "One", they are "One, Twenty-one..." Such plurals cannot be
> translated
> in Transifex at all. The validity check refuses any Slavic langauge
> translation (see the translation of Transifex itself).
>
> If you translate
>
> "One file removed"
> "%d files removed"
> "%d files removed"
>
> the validation will be failed because the first form (0th case) does not
> contain enough cases to be split into "1, 21, 31..."
>
> If you translate
>
> "%d file removed"
> "%d files removed"
> "%d files removed"
>
> the validation will be failed because there is "%d" in the first case, but
> the
> checker thinks there should not be any replacer...
>
> 3.
>
> ngettext ("Delete the selected file?",
>                 "Delete the selected files?", n)
>
> Fail. Without number (replacer), there are only two plural forms in the
> Slavic
> languages: "one" and "many". But the 0th rule in the standard (CLDR)
> combines
> "one" and "many". They should be split to give the correct translation.
>
> That's why Russian, Serbian and Ukrainian KDE and GNOME teams use the
> plural
> rules with 4 forms (n=1 is separated in its own case).
>
> Hope this helps to understand the current header of Audacity file.
>
> Thanks for your work.
>
> Best regards,
> Yuri
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Audacity-translation mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/audacity-translation
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Audacity-translation mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-translation

Reply via email to