Skillpedia
الواجهات (UI/UX)28k · #9875

rtl-aware-development

ما الذي تفعله

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

متى تستخدمها

  • ✓عندما تبني تخطيطًا يجب أن يدعم اللغات التي تُكتب من اليمين إلى اليسار أو تراجعه.
  • ✓عندما يستخدم CSS قيم يمين ويسار يجب أن تنقلب للنص من اليمين إلى اليسار.
  • ✓عندما يبدو النص المختلط بين الإنجليزية والاتجاه من اليمين إلى اليسار أو المسارات خاطئًا في قائمة أو لائحة.

رابط المهارة

https://github.com/Kilo-Org/kilocode/blob/main/.opencode/skills/rtl-aware-development/SKILL.md

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

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

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

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

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

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

“واجهتي تنكسر عندما أغيّر اللغة إلى العربية. راجع CSS واخبرني بما أغيّره حتى ينقلب التخطيط بشكل صحيح.”

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

كيف تعمل

يتحقق الوكيل من اتجاه المستند، ويستبدل قيم CSS الفيزيائية لليمين واليسار بخصائص منطقية، ويعزل النصوص ذات الاتجاهات المختلفة. ويقلب الأيقونات التي لها معنى اتجاهي فقط، ويترك الشعارات والمخططات وأدوات تشغيل الوسائط كما هي.

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

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

RTL-Aware Development

Treat direction as independent from language. Test English in both directions as well as real RTL and mixed-script content.

Guidelines

  • Set lang and dir on the document, and propagate direction through component providers used by portaled menus and popovers. Do not change the selected locale merely to force RTL.
  • Keep DOM and focus order semantic. Flexbox and Grid already follow dir; do not add row-reverse, CSS order, or reversed markup just to mirror a layout.
  • Prefer logical CSS for semantic layout. Reserve physical coordinates for pointer positions, canvas geometry, native window controls, and other genuinely physical placement.
/* Avoid */
padding-left: 12px;
right: 0;
border-right: 1px solid;
text-align: left;

/* Prefer */
padding-inline-start: 12px;
inset-inline-end: 0;
border-inline-end: 1px solid;
text-align: start;
  • Isolate mixed-direction text. Use dir="auto" or <bdi> for unknown text; keep code, URLs, IDs, and filesystem paths LTR without forcing the surrounding component LTR.
<span class="file-row"><bdi dir="auto">README.md</bdi></span> <bdi dir="ltr"><code>C:\src\app.ts</code></bdi>
  • Mirror directional meaning, not every image. Back/forward, previous/next, disclosure, indentation, and directional progress may need mirroring. Do not mirror brands, clocks, media controls, charts, or text. Reverse physical gradients, translateX, SVG transforms, and animation deltas explicitly.
  • Map interactions through direction. clientX remains physical; resizing a logical edge needs an RTL-aware delta. Logical previous/next keyboard controls may swap ArrowLeft/ArrowRight. Follow the relevant WAI-ARIA widget pattern.
  • Do not assume LTR scrolling. RTL scrollLeft can start at 0 and become negative. Prefer scrollIntoView({ inline: "nearest" }) or a tested direction-normalizing helper.
  • For Electron title bars, prefer native caption controls and use titleBarOverlay plus env(titlebar-area-*) for the safe content rectangle. Keep Windows/macOS native-control avoidance and trafficLightPosition physical; keep app navigation inside that rectangle logical. Mark interactive titlebar children app-region: no-drag.
  • Verify behavior, not screenshots alone. Check computed styles, pseudo-element geometry, hit zones, focus order, keyboard behavior, submenu direction, zoom/scaling, and both LTR and RTL scroll endpoints.

Test Matrix

  • English + LTR
  • English + forced RTL
  • A real RTL locale + RTL
  • Mixed RTL/LTR content, long labels, numbers, code, and paths
  • Keyboard, pointer resize, scrolling, menus/submenus, and Electron titlebar controls in both directions

References

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

ما CSS المنطقي؟

يستخدم start وend بدل left وright، فتنقلب التخطيطات تلقائيًا للنص من اليمين إلى اليسار.

هل يجب قلب كل الأيقونات؟

لا. تُقلب فقط الأيقونات ذات المعنى الاتجاهي، مثل الرجوع أو التالي.

كيف يُعالج النص المختلط؟

يُضاف للنص غير المعروف سمة اتجاه أو وسم bdi، وتبقى الشيفرة والروابط والمسارات من اليسار إلى اليمين.

التفاصيل

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

OpenCode Desktop should be RTL-aware. Use when implementing or reviewing RTL/LTR behavior in the web app, desktop app, CSS, menus, scrolling, resizing, icons, mixed-direction text, or Electron title bars.

repo: Kilo-Org/kilocode

الشعبية

نجوم GitHub
28k
الترتيب
#9875
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

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

0

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

التعليقات

  • …

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

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