Skillpedia
المواقع والواجهات (frontend)75k · #2981

pluralization

ما الذي تفعله

تراجع هذه المهارة طريقة عرض الموقع للأعداد، مثل «لديك 3 عناصر»، وتعدّل الشيفرة ليكون الجمع صحيحًا لكل لغة. وهي موجهة لمطوري التطبيقات متعددة اللغات.

متى تستخدمها

  • ✓عندما تطلب من الوكيل فحص طريقة كتابة الأعداد وصيغ الجمع في ترجمات تطبيقك.
  • ✓عندما يبدو النص المترجم غريبًا لأن صيغة الجمع غير مناسبة للغة.
  • ✓عندما تضبط مكتبة للتدويل وتريد أن يُختار الجمع بشكل صحيح.

رابط المهارة

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/pluralization/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/pluralization/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“يعرض تطبيقي أعدادًا مثل «1 items» في بعض اللغات. هل يمكنك إصلاح طريقة التعامل مع الجمع لكل لغاتي؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يجد الوكيل الأماكن التي يُربط فيها العدد بالنص بعلامات الجمع، أو التي تفحص المفرد والجمع فقط. ويستبدلها بـ Intl.PluralRules أو صياغة ICU، فيُختار الشكل الصحيح لكل لغة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Handle plural forms with Intl.PluralRules or ICU MessageFormat

Pluralization rules vary dramatically across languages — what works as a simple singular/plural branch in English produces grammatically wrong output in Arabic, Russian, Polish, and dozens of other languages. Shipping incorrect plurals signals low translation quality and breaks trust with native speakers in target markets.

Quick Reference

  • English has 2 plural forms but Arabic has 6 and Russian has 3
  • Never concatenate a count with a string like '"You have " + count + " items"'
  • Use Intl.PluralRules to select the right message key per locale
  • ICU MessageFormat in react-intl or i18next handles plural selection automatically

Check

Find all places in this codebase where a count value is concatenated with a string or where only singular/plural branching is used, without Intl.PluralRules or ICU plural syntax.

Fix

Replace count string concatenation and binary singular/plural logic with Intl.PluralRules-based key selection or ICU MessageFormat plural syntax so that all CLDR plural categories are covered for every target locale.

Explain

Explain why languages have different numbers of plural forms, what CLDR plural categories are, and how Intl.PluralRules and ICU MessageFormat solve pluralization correctly across locales.

Code Review

Review translation files and components that render counts. Flag any strings that concatenate a number with text, any ternary that picks only between "singular" and "plural", and any i18next or react-intl message that is missing plural keys required by the target locale.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/i18n/pluralization

الأسئلة الشائعة

لماذا لا يكفي مفرد واحد وجمع واحد؟

تقول المهارة إن اللغات تختلف كثيرًا، فالإنجليزية لها شكلان للجمع، بينما للعربية ستة، وللروسية ثلاثة.

ما Intl.PluralRules؟

ميزة مدمجة في المتصفح تختار فئة الجمع الصحيحة لعدد ضمن لغة معينة.

هل تعمل مع المكتبات الشائعة؟

تذكر المهارة صياغة ICU MessageFormat في مكتبات مثل react-intl وi18next، وهي تتعامل مع اختيار الجمع.

التفاصيل

الوصف الأصلي من المؤلف

Use when reviewing string concatenation involving counts, translation key lookups, or i18n library configurations to check whether plural forms are handled correctly for all target locales.

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#2981
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة