Plural forms in Pootle

Hi all,

It seems some language settings in Pootle are missing the plural form
now that it has been added to master.
If so, please send a mail here (instead of in Pootle) and indicate the
plural form that would work for your language.
There is a listing of plural forms here:
http://www.unicode.org/cldr/charts/30/supplemental/language_plural_rules.html

and a table with the corresponding equation here:
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html

Check that this table has no error and ask the equation to be added to
your language.
If you are not using Pootle, I guess it has to be added to the header of
your .po files.

For me, when translating FR strings with plural forms, it gives a
critical error, I guess we will have to adapt pocheck script. But
Christian is on vacation this week, so I'll see with him when he is back.

Thanks in advance
Cheers
Sophie

Thanks! I've sent a pull request for my locale: https://github.com/translate/l10n-guide/pull/73

sophi schrieb:

and a table with the corresponding equation here:
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html

Check that this table has no error and ask the equation to be added to
your language.
If you are not using Pootle, I guess it has to be added to the header of
your .po files.

Hi Sophie,

in the list behind the link above Upper Sorbian and Lower Sorbian are missing. But they are in the CLDR list.

This applies to both Sorbian languages:

nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);

This is the system:

1, 101, 201, 301, etc. --> Nominative/Accusative singular
2, 102, 202, 302, etc. --> Nominative/Accusative dual
3/4, 103/104, 203/204, 303/304, etc. --> Nominative/Accusative plural
0, 5-100, 105-200, 205-300, 305-400, etc. --> Genitive plural

Decisive is the last digit, with decimal numbers as well. If the last digit behind the comma (in English: point) is 1 then nominative/accusative singular, if it is 2 nominative/accusative dual and so on.

So, both Sorbian languages have 4 forms and the same rules.

Christian already knows about that. He enabled it on Pootle that I can translate the strings with plural forms. Before there was no translation text box because Pootle didn't know the Sorbian plural rules.

He wrote me: "Set it to four plural forms without explicitly listing the equation - that
allows for translation already."

Kind regards,

Michael

Hi Michael,

sophi schrieb:

and a table with the corresponding equation here:
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html

Check that this table has no error and ask the equation to be added to
your language.
If you are not using Pootle, I guess it has to be added to the header of
your .po files.

Hi Sophie,

in the list behind the link above Upper Sorbian and Lower Sorbian are
missing. But they are in the CLDR list.

This applies to both Sorbian languages:

nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ?
3 : 0);

This is the system:

1, 101, 201, 301, etc. --> Nominative/Accusative singular
2, 102, 202, 302, etc. --> Nominative/Accusative dual
3/4, 103/104, 203/204, 303/304, etc. --> Nominative/Accusative plural
0, 5-100, 105-200, 205-300, 305-400, etc. --> Genitive plural

Decisive is the last digit, with decimal numbers as well. If the last
digit behind the comma (in English: point) is 1 then
nominative/accusative singular, if it is 2 nominative/accusative dual
and so on.

So, both Sorbian languages have 4 forms and the same rules.

Not simple :wink:

Christian already knows about that. He enabled it on Pootle that I can
translate the strings with plural forms. Before there was no translation
text box because Pootle didn't know the Sorbian plural rules.

He wrote me: "Set it to four plural forms without explicitly listing the
equation - that
allows for translation already."

Thanks for letting me know, and yes, it seems it's enough to add the
number of plurals and let plural equation field blank to be able to
translate in Pootle.

Cheers
Sophie

Hi Danylo,

Check that this table has no error and ask the equation to be added to
your language.

Thanks! I've sent a pull request for my locale:
https://github.com/translate/l10n-guide/pull/73

Great :slight_smile:
Cheers
Sophie

Hi there,
Hebrew is now using a new plural forms formula:
https://github.com/translate/l10n-guide/pull/71/commits/259079bb9c8af0042fe2ff6471cb33ee784b9cff

Kind regards,
Yaron Shahrabani

<DevOps - Hebrew translator>

Hi *,

[…]

> He wrote me: "Set it to four plural forms without explicitly listing the
> equation - that
> allows for translation already."

Thanks for letting me know, and yes, it seems it's enough to add the
number of plurals and let plural equation field blank to be able to
translate in Pootle.

Yes, this makes it available in pootle, but I don't know whether the
plural rules are needed in the po file for proper use of the different
forms, or whether they are just informational for the po-editing tool
and gettext will ignore it and use whatever it knows about the
language.

In other words: I have no idea/didn't check whether the equation is
required or optional for proper use in LO.

(If they are required, then further tweaks to pocheck utility are
necessary, right now it disregards most of the PO-Header and instead
writes its own, possibly stripped-down version when there are errors
in the po-file)

ciao
Christian

Hi Sophie,

It seems some language settings in Pootle are missing the plural form
now that it has been added to master.

Where should I miss/how can I see that

If so, please send a mail here (instead of in Pootle) and indicate the
plural form that would work for your language.> There is a listing of plural forms here:
http://www.unicode.org/cldr/charts/30/supplemental/language_plural_rules.html

and a table with the corresponding equation here:
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html

Those are fine for Dutch.

Cheers - Cor

High,
in Greek it is displayed as (e.g. STR_SCATTR_PAGE_SCALE_PAGES
Τοποθεσίες: sc/inc/globstr.hrc:317 Μονάδα #159066571
<https://translations.documentfoundation.org/el/libo_ui/translate/sc/messages.po#unit=159066571>
)
English
Μορφή πληθυντικού του 0
One page
Μορφή πληθυντικού του 1
%1 pages

in English and the relevant in Greek
which is
Plural form 0
One page
and Plural form 1
%1 pages

and is probably wrong
and the translation of English in Greek (for the English part is wrong).
Plurals form for Greek is nplurals=2; plural=(n != 1);
and in Plural rules it is only for some kind feminine.

έγραψε:

Hi Cor,

Hi Sophie,

It seems some language settings in Pootle are missing the plural form
now that it has been added to master.

Where should I miss/how can I see that

If the field is blank, you won't be able to translate and will have an
error message (from what I've understood from the requests in Pootle
messages). But I'll check for your language and that was the purpose of
my mail, to check only for languages who meet issues, and not for all :slight_smile:

If so, please send a mail here (instead of in Pootle) and indicate the
plural form that would work for your language.> There is a listing of plural forms here:
http://www.unicode.org/cldr/charts/30/supplemental/language_plural_rules.html

and a table with the corresponding equation here:
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html

Those are fine for Dutch.

Ok, thanks :slight_smile:
Cheers
Sophie

Hi Dmitris,

High,
in Greek it is displayed as (e.g. STR_SCATTR_PAGE_SCALE_PAGES
Τοποθεσίες: sc/inc/globstr.hrc:317 Μονάδα #159066571
<https://translations.documentfoundation.org/el/libo_ui/translate/sc/messages.po#unit=159066571>
)
English
Μορφή πληθυντικού του 0
One page
Μορφή πληθυντικού του 1
%1 pages

in English and the relevant in Greek
which is
Plural form 0
One page
and Plural form 1
%1 pages

and is probably wrong
and the translation of English in Greek (for the English part is wrong).
Plurals form for Greek is nplurals=2; plural=(n != 1);
and in Plural rules it is only for some kind feminine.

Thanks for your feedback. I'll check and correct the plural form if it's
different, otherwise, I'll come back to you.

Cheers
Sophie

Dear Sophie,

Could you please update Kazakh plural forms to "nplurals=1; plural=0" ?

Thanks in advance,

Hi Dimitris,

Hi Dmitris,

High,
in Greek it is displayed as (e.g. STR_SCATTR_PAGE_SCALE_PAGES
Τοποθεσίες: sc/inc/globstr.hrc:317 Μονάδα #159066571
<https://translations.documentfoundation.org/el/libo_ui/translate/sc/messages.po#unit=159066571>
)
English
Μορφή πληθυντικού του 0
One page
Μορφή πληθυντικού του 1
%1 pages

in English and the relevant in Greek
which is
Plural form 0
One page
and Plural form 1
%1 pages

and is probably wrong
and the translation of English in Greek (for the English part is wrong).
Plurals form for Greek is nplurals=2; plural=(n != 1);
and in Plural rules it is only for some kind feminine.

Thanks for your feedback. I'll check and correct the plural form if it's
different, otherwise, I'll come back to you.

The plural form for your language in Pootle is correct. Could you fill a
bug report on this so we can track your problem?
Thanks in advance,
Cheers
Sophie

Hi Baurzhan,

Dear Sophie,

Could you please update Kazakh plural forms to "nplurals=1; plural=0" ?

It's already in Pootle, let me know if you meet any issue.
Cheers
Sophie

Hi,
I found this link in internet
https://www.cssigniter.com/wordpress-localization-plural-forms-work/, where
I found an example for Greek plurals.

msgid "%s apple"msgid_plural "%s apples"msgstr[0] ""msgstr[1] ""

Which I would go on and translate as:

msgid "%s apple"msgid_plural "%s apples"msgstr[0] "%s μήλο"msgstr[1] "%s μήλα"

Note that the *msgstr[0]* line contains the singular form, and *not the
translation of the words for the case of **%s** being equal to **0*.
*msgstr* is really a zero-based array, and *msgstr[0]* is its first
element. Similarly, *msgstr[1]* is the second element, and does not hold
the string for *%s = 1*. This is due to the *nplurals=2; plural=(n != 1);*
line.
*nplurals=2; plural=(n != 1);* is a C-syntax expression, and as far as the
Plural Forms are concerned, it’s almost identical to PHP’s expressions. C
variables don’t get a dollar sign in front of them, so you can now start
seeing that the content of that line is just two variables getting assigned
something. Breaking it into two lines and adding some spaces makes it a bit
more clear.

There, I could see that "the *msgstr[0]* line contains the *singular form*,
and *not the translation of the words for the case of **%s** being equal
to **0", so: the translation of the words is right, but not the type: *Μορφή
πληθυντικού του 0. (Plural form 0 or 1) and I don't know where is it taken
from.

In Greek there is only one plural (with different cases) and so the
nplurals=2 is misleading.

Bye.

έγραψε:

Hi Sophie,
I see an error at
https://translations.documentfoundation.org/kk/libo_ui/translate/sc/messages.po#unit=159071307
When I downloaded PO file directly, the plural forms header was not
present in it.
Thanks,

Hi Baurzhan,

Hi Baurzhan,

Dear Sophie,

Could you please update Kazakh plural forms to "nplurals=1; plural=0" ?

It's already in Pootle, let me know if you meet any issue.
Cheers
Sophie

Hi Sophie,
I see an error at
https://translations.documentfoundation.org/kk/libo_ui/translate/sc/messages.po#unit=159071307
When I downloaded PO file directly, the plural forms header was not
present in it.

According to
https://github.com/translate/l10n-guide/blob/master/docs/l10n/pluralforms.rst

Kazakh has nplurals=2 so I've updated your language in Pootle to reflect
that. Let me know if now it's ok.

Cheers
Sophie

Hi *,

I see an error at
https://translations.documentfoundation.org/kk/libo_ui/translate/sc/messages.po#unit=159071307

If you mean the printf() check - just silence it for that unit (klick
the (-) symbol next to it)

It's a limitation in pootle/translate-toolkit where it cannot tell
whether a %1 needs to be present in the translated string or not when
the English one has one form with no placeholder.

See https://github.com/translate/translate/issues/2736 /
https://github.com/translate/pootle/issues/3122

ciao
Christian

Dear Sophie,

We've been using "nplurals=1; plural=0" form for quite a while in,
say, GNOME and Xfce, and Mozilla as well and never had any problems.

Could you please revert the Pootle plural form of Kazakh language to it?

I will silence the printf checks then as Christian suggested.

Thanks,

Hi Baurzhan,

Dear Sophie,

We've been using "nplurals=1; plural=0" form for quite a while in,
say, GNOME and Xfce, and Mozilla as well and never had any problems.

Could you please revert the Pootle plural form of Kazakh language to it?

I will silence the printf checks then as Christian suggested.

This is done, thanks for the feedback. It seems the list at
Translate.org is not right then.
Cheers
Sophie