- How you use it
- You paste it when you need it
- What it can do
- writes files; Shell and network instructions not verified; read the prompt text before running it.
- What's inside
The option
| Option | APrompt · v1.0.0Arabic RTL component repair brief |
|---|---|
| How you use it | You paste it when you need it |
| What it can do | writes files; Shell and network instructions not verified; read the prompt text before running it. |
| What's inside |
What this thread does
Set lang="ar" dir="rtl" on Arabic documents, convert direction-dependent CSS to logical properties, and verify mixed text and interaction order in both directions.
Do first: Set lang="ar" dir="rtl" on the Arabic document root.
Steps
1. Capture the same page in English and Arabic. Give the agent a bounded component list and ask it to classify physical left/right rules as intentional or direction-dependent. 2. Set the document language and direction independently. Language does not imply direction. Use HTML dir for base direction, following W3C structural guidance. 3. Apply these mappings only where the physical side was the reading start/end. See MDN logical properties.
| Existing intent in English | Direction-aware CSS |
|---|---|
| Leading outer spacing | margin-inline-start |
| Trailing inner spacing | padding-inline-end |
| Position at reading end | inset-inline-end |
| Align to reading start | text-align: start |
4. Keep DOM order meaningful for keyboard and assistive technology. Do not combine RTL with row-reverse merely to mirror the layout; inspect the resulting order before changing flex rules. 5. Isolate unknown inserted names with <bdi> or an appropriate dir="auto" boundary. For known Latin fragments use a direction boundary such as <span dir="ltr">ABC-42</span>. W3C inline guidance explains isolation; do not reverse strings. 6. Review navigation arrows individually. Mirror an arrow expressing reading/navigation direction when appropriate; do not mirror logos, photos, media controls or every icon mechanically.
Diagnostic: Arabic text is translated but the layout still reads left to right
Inspect the computed document direction first, then positioned children, physical offsets, portal-mounted menus and component overrides. A correctly translated label does not prove the surrounding layout supports RTL.
Acceptance checks for the agent
Create paired screenshots at the same viewport in English and Arabic. Assert the root language/direction, no unintended horizontal overflow, readable phone/order identifiers, non-overlapping labels, reachable focus targets and correct menu anchors. Cover dialogs, forms, tables, validation errors and long content, not just the home page. Use the existing browser test runner; keep screenshot baselines separate by locale. These are proposed checks, not reported passes.
Prompt for the agent
Fix only the selected components. Explain each left/right rule you keep or replace. Use semantic document direction and logical spacing, preserve DOM reading order, and show paired screenshots plus keyboard results. Mark font shaping and Arabic phrasing for human review.
Evidence — checked 2026-10-28
W3C Internationalization says “Never use CSS to apply the base direction.” Rupak Amin's RAITHub checklist proposes checking markup, overflow and menus separately. This is practitioner guidance, not an independent controlled trial. Evidence: none found for a public trial of this exact agent workflow.
Mistakes and limits
A pseudo-RTL view cannot prove Arabic shaping, punctuation, line breaks or screen-reader behavior. Logical properties respond to writing mode as well as direction; confirm the app's writing mode. Do not replace intentionally physical map or canvas coordinates. No browser/device matrix or Arabic accessibility review was run. This uses platform features rather than a version-specific CSS library and makes no release-version claim.
Started from a post by @W3C Internationalization, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.