«Plural Forms»: الفرق بين المراجعتين

من ويكي عربآيز
اذهب إلى: تصفح، ابحث
(Plurals)
(Remove an unnecessary term)
سطر 14: سطر 14:
 
* Sixth form: for numbers above 100 ending with 0, 1 or 2 (like: 100, 232, 3001)
 
* Sixth form: for numbers above 100 ending with 0, 1 or 2 (like: 100, 232, 3001)
   
For Mozilla products (Firefox, Thunderbird, Sunbird, Fennec), the case where n == 0 is shifted to become the last case (due to some backward compatibility with the older plural rule).
+
For Mozilla products (Firefox, Thunderbird, Sunbird, Fennec), the case where <code>n == 0</code> is shifted to become the last case (due to some backward compatibility with the older plural rule).
   
 
== Plural formula ==
 
== Plural formula ==
 
This is the plural formula used for the forms above:
 
This is the plural formula used for the forms above:
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;
+
nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;
   
   
 
An exception for Mozilla products is:
 
An exception for Mozilla products is:
 
nplurals=6; plural=n==0 ? 5 : n==1 ? 0 : n==2 ? 1 : n%100>=3 && n%100<=10 ? 2 : n%100>=11 ? 3 : 4;
<pre dir="ltr">
 
  +
nplurals=6; plural=n==0 ? 5 : n==1 ? 0 : n==2 ? 1 : n%100>=3 && n%100<=10 ? 2 : n%100>=11 && n%100<=99 ? 3 : 4;
 
</pre>
 
   
 
== Examples ==
 
== Examples ==
   
  +
<pre>
 
 
msgid "1 Item"
 
msgid "1 Item"
 
msgid_plural "%d Items"
 
msgid_plural "%d Items"
سطر 37: سطر 36:
 
msgstr[4] "%d عنصرا"
 
msgstr[4] "%d عنصرا"
 
msgstr[5] "%d عنصر"
 
msgstr[5] "%d عنصر"
  +
</pre>
 
   
 
As for Mozilla:
 
As for Mozilla:
  +
<pre>
 
 
msgid "1 Item"
 
msgid "1 Item"
 
msgid_plural "%d Items"
 
msgid_plural "%d Items"
سطر 49: سطر 48:
 
msgstr[4] "%d عنصر"
 
msgstr[4] "%d عنصر"
 
msgstr[5] "لا عناصر"
 
msgstr[5] "لا عناصر"
  +
</pre>
 
 
[[Category:Standardization]]
 
[[Category:Standardization]]

نسخة 07:51، 12 فبراير 2010

Arabic.png

هذه الصفحة موجودة بالعربية تحت عنوان صيغ المعدود

GNU Gettext is used by most free software as a localization framework, one of GNU Getext features is plural forms.

Plurals

We are using now a 6 forms plural formula:

  • First form: for 0
  • Second form: for 1
  • Third form: for 2
  • Fourth form: for numbers that end with a number between 3 and 10 (like: 103, 1405, 23409).
  • Fifth form: for numbers that end with a number between 11 and 99 (like: 1099, 278).
  • Sixth form: for numbers above 100 ending with 0, 1 or 2 (like: 100, 232, 3001)

For Mozilla products (Firefox, Thunderbird, Sunbird, Fennec), the case where n == 0 is shifted to become the last case (due to some backward compatibility with the older plural rule).

Plural formula

This is the plural formula used for the forms above:

nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;


An exception for Mozilla products is:

nplurals=6; plural=n==0 ? 5 : n==1 ? 0 : n==2 ? 1 : n%100>=3 && n%100<=10 ? 2 : n%100>=11 ? 3 : 4;


Examples

msgid "1 Item"
msgid_plural "%d Items"
msgstr[0] "لا عناصر"
msgstr[1] "عنصر واحد"
msgstr[2] "عنصران"
msgstr[3] "%d عناصر"
msgstr[4] "%d عنصرا"
msgstr[5] "%d عنصر"


As for Mozilla:

msgid "1 Item"
msgid_plural "%d Items"
msgstr[0] "عنصر واحد"
msgstr[1] "عنصران"
msgstr[2] "%d عناصر"
msgstr[3] "%d عنصرا"
msgstr[4] "%d عنصر"
msgstr[5] "لا عناصر"