Re: plural forms translation, ngettext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 05, 2018 at 03:57:20PM +0000, Kaganski Mike wrote:
> On 10/5/2018 6:09 PM, Caolán McNamara wrote:
> > To current NC_(context, string) we add NNC_(context, singular, plural)
> > when declaring the strings for translation
> 
> How does it play with other languages, where we might have more complex 
> rules? E.g., in Russian, a "singular" form might be used for any decimal 
> integer ending with 1 except 11 (e.g., 21, 31, 101...); also endings for 
> numbers with 2, 3, 4 differ from 5 and greater (22 from 25 likewise)...

There is plural formula in the header of the PO files, and it is used
to determine the number of forms and when to use each. For example the
Arabic formula is:
  nplurals=6;
  plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;

Arabic PO files will have:
msgctxt "SCSTR_TOTAL"
msgid "1 result found"
msgid_plural "%1 results found"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgstr[3] ""
msgstr[4] ""
msgstr[5] ""

Regards,
Khaled
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux