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

من ويكي عربآيز
اذهب إلى: تصفح، ابحث
(Plurals)
ط
 
(3 مراجعات متوسطة بواسطة مستخدمين اثنين آخرين غير معروضة)
سطر 1: سطر 1:
<div class=english>
 
 
 
{{Arabic|صيغ المعدود}}
 
{{Arabic|صيغ المعدود}}
 
GNU Gettext is used by most free software as a localization framework, one of GNU Getext features is [http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html plural forms].
 
GNU Gettext is used by most free software as a localization framework, one of GNU Getext features is [http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html plural forms].
سطر 14: سطر 12:
 
* 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: سطر 34:
 
msgstr[4] "%d عنصرا"
 
msgstr[4] "%d عنصرا"
 
msgstr[5] "%d عنصر"
 
msgstr[5] "%d عنصر"
  +
</pre>
 
   
 
As for Mozilla:
 
As for Mozilla:
  +
<pre>
 
 
<pre>
 
msgid "1 Item"
 
msgid "1 Item"
 
msgid_plural "%d Items"
 
msgid_plural "%d Items"
سطر 50: سطر 48:
 
msgstr[5] "لا عناصر"
 
msgstr[5] "لا عناصر"
 
</pre>
 
</pre>
  +
 
[[Category:Standardization]]
 
[[Category:Standardization]]
  +
[[Category:English]]

المراجعة الحالية بتاريخ 02:18، 26 يناير 2017

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] "لا عناصر"