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

direction-attribute

ما الذي تفعله

تتحقق هذه المهارة من أن الصفحة تضبط اتجاه النص الصحيح للغتها. وهي موجهة إلى المطورين الذين يبنون مواقع باللغات التي تُكتب من اليمين إلى اليسار أو بمحتوى مختلط الاتجاهات.

متى تستخدمها

  • ✓عندما يضيف موقعك محتوى بالعربية أو العبرية أو الفارسية أو الأردية.
  • ✓عندما تمتزج أسماء المستخدمين أو تعليقاتهم بين اتجاه من اليسار إلى اليمين ومن اليمين إلى اليسار.
  • ✓عندما تبدو القوائم والتخطيطات معكوسة للقراء الذين يقرؤون من اليمين.

رابط المهارة

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

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

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

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

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

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

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

“هل تستطيع التحقق من أن موقعي يُعرض بشكل صحيح للقراء العرب؟”

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

كيف تعمل

يتحقق الوكيل من سمة dir في الصفحة وفي الأجزاء ذات الاتجاه المختلط، مثل تعليقات المستخدمين. ويقترح إضافة القيمة الصحيحة أو وسم عزل حيث يلزم.

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

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

Set text direction for RTL languages

Without proper dir attributes, RTL text displays incorrectly, UI elements appear backwards, and screen readers announce content in the wrong order.

Quick Reference

  • Set dir="rtl" on <html> for Arabic, Hebrew, Persian, Urdu
  • Use dir="auto" for user-generated content
  • Combine with CSS logical properties (inline-start, inline-end)
  • Test UI mirroring for navigation, icons, and layouts
  • Use bidi isolation such as <bdi> for inline mixed-direction user content

Check

Verify that this HTML document uses the appropriate dir attribute to indicate text direction for right-to-left languages like Arabic, Hebrew, or mixed content. Check user-generated inline text for dir="auto" or bidi isolation where names, handles, or snippets mix writing directions.

Fix

Add the dir attribute to the html element or specific elements with values 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto' for automatic detection. Use <bdi> or equivalent bidi isolation for mixed-direction inline content.

Explain

Explain how the dir attribute helps browsers and screen readers properly display and navigate text in different writing directions.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Set text direction for RTL languages. Flag exact elements, attributes, and routes where the rendered HTML violates the rule. Inspect user-generated inline content, not only page-level locale wrappers.


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

Rule page: https://frontendchecklist.io/rules/html/direction-attribute

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

ماذا تفعل سمة dir؟

تخبر المتصفح باتجاه سريان النص، من اليسار إلى اليمين أو من اليمين إلى اليسار.

ما هو عزل الاتجاه bidi isolation؟

يمنع النص المختلط الاتجاه، مثل اسم بلغة أخرى، من إرباك النص المجاور له. وتقترح المهارة وسم bdi لهذا.

هل تشمل المهارة انعكاس التخطيط؟

تقترح المهارة اختبار ما إذا كانت القوائم والأيقونات والتخطيطات تنعكس بشكل صحيح.

التفاصيل

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

Use when reviewing templates, rendered HTML, or shared components related to Set text direction for RTL languages. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

الشعبية

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

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

0

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

التعليقات

  • …

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

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