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

من ويكي عربآيز
اذهب إلى: تصفح، ابحث
ط
ط (Examples)
سطر 22: سطر 22:
 
<pre>
 
<pre>
 
msgid "1 Item"
 
msgid "1 Item"
msgid_plural "%1 Items"
+
msgid_plural "%d Items"
 
msgstr[0] "لا عناصر"
 
msgstr[0] "لا عناصر"
 
msgstr[1] "عنصر واحد"
 
msgstr[1] "عنصر واحد"
 
msgstr[2] "عنصران"
 
msgstr[2] "عنصران"
msgstr[3] "%1 عناصر"
+
msgstr[3] "%d عناصر"
msgstr[4] "%1 عنصرا"
+
msgstr[4] "%d عنصرا"
msgstr[5] "%1 عنصر"
+
msgstr[5] "%d عنصر"
 
</pre>
 
</pre>
 
[[Category:Standardization]]
 
[[Category:Standardization]]

نسخة 17:01، 6 فبراير 2008

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)

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 && n%100<=99 ? 4 : 5;

Examples

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