currency-formatting
ما الذي تفعله
تتحقق هذه المهارة من طريقة عرض الموقع للمال والأرقام والتواريخ للناس في بلدان مختلفة. وهي موجهة إلى المطورين الذين يبنون مواقع تخدم أكثر من منطقة.
متى تستخدمها
- ✓عندما تعرض أسعارك رمزًا أو فاصلًا خاطئًا بالنسبة إلى بلد ما.
- ✓عندما تظهر التواريخ بصيغة تربك الناس في الخارج.
- ✓عندما تضيف لغة أو منطقة جديدة إلى موقعك.
رابط المهارة
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/currency-formatting/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“هل تستطيع التحقق من أن الأسعار في موقعي تظهر بشكل صحيح للزوار في الدول الأخرى؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يبحث الوكيل عن الأماكن التي تُكتب فيها الأرقام أو الأسعار أو التواريخ يدويًا. ويقترح استخدام أدوات التنسيق المدمجة في المتصفح مع لغة الزائر.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Use Intl APIs for currency, number, and date formatting
Number and currency formatting rules differ significantly across locales — a value formatted as "$1,234.56" in the US is written "1.234,56 $" in Germany and "¥1,235" in Japan. Hardcoded formatting causes incorrect display for international users and is expensive to maintain manually as you add locales.
Quick Reference
- Never hardcode currency symbols or thousand separators like $ or comma
- Use Intl.NumberFormat with the currency style for monetary values
- Use Intl.DateTimeFormat for locale-aware date and time display
- Pass the user locale explicitly rather than relying on the browser default
- Use Intl.Collator and locale fallback chains for sorting and searching
Check
Identify all places in this codebase where numbers, currencies, or dates are formatted manually instead of using Intl.NumberFormat or Intl.DateTimeFormat. Also flag locale-sensitive sorting that uses plain string comparison instead of Intl.Collator and any formatter that lacks a fallback locale.
Fix
Replace manual number and currency formatting with Intl.NumberFormat and replace manual date formatting with Intl.DateTimeFormat, passing the user locale explicitly. Use Intl.Collator for locale-aware sorting and resolve a supported fallback locale when the requested locale is unavailable.
Explain
Explain why locale-aware formatting with Intl APIs is required for international applications, what goes wrong when formatting is hardcoded, and why sorting/searching should also use locale-aware comparison.
Code Review
Review utility functions and components that render numbers, prices, percentages, or dates. Flag any hardcoded currency symbols, separators, or date format strings, and show Intl-based alternatives.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/i18n/currency-formatting
الأسئلة الشائعة
لماذا تبدو الأسعار مختلفة في بلدان أخرى؟
الدول تستخدم رموز عملة وفواصل عشرية وفواصل مختلفة، فيمكن كتابة المبلغ نفسه بطرق مختلفة تمامًا.
أي أدوات المتصفح تستخدمها المهارة؟
تقترح كائنات Intl للتنسيق التي تتضمنها المتصفحات الحديثة للأرقام والعملات والتواريخ والترتيب.
هل يجب ضبط اللغة في الكود؟
توصي المهارة بتمرير لغة المستخدم بشكل صريح بدلًا من الاعتماد على الإعداد الافتراضي للمتصفح.
التفاصيل
الوصف الأصلي من المؤلف
Use when reviewing utility functions, component props, or template strings that format numbers, prices, or dates to check whether Intl APIs are used correctly.
الشعبية
- نجوم GitHub
- 75k
- الترتيب
- #2805
- الترخيص
- MIT
- آخر تحديث
- 31/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
frontendchecklist
75kيفحص شيفرة الواجهة الأمامية والصفحات الحية مقابل أكثر من 380 قاعدة للوصول وسرعة الأداء وتحسين محركات البحث والأمان، بأداة سطر أوامر.
frontend-checklist-global
75kيدقق مشروع الواجهة الأمامية وفق كل قواعد Front-End Checklist البالغ عددها 386، ويقدم إصلاحًا محددًا لكل مشكلة وجدت.
404-page
75kيتأكد من أن صفحة الصفحات غير الموجودة تقدم روابط مفيدة وتُرجع رمز حالة 404 حقيقيًا، لمساعدة الزوار التائهين على إيجاد طريقهم.
about-page
75kيراجع ما إذا كان لموقعك صفحة «من نحن» واضحة تشرح من يديره، لبناء الثقة لدى الزوار ومحركات البحث.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.