Plan and implement right-to-left support
Plans and implements right-to-left layout support (logical properties, mirroring rules, bidi text, icons) for a web or mobile UI. Use when adding Arabic, Hebrew, Persian or Urdu.
Right-to-left support is not transform: scaleX(-1) on the whole page. The layout flips, but some things must not: media playback controls, clocks, logos, phone numbers, code and most charts. Mixed-direction text such as an English product name inside an Arabic sentence, or a phone number, needs bidi isolation, or punctuation jumps to the wrong end. Most breakage comes from physical properties (left, marginLeft, paddingRight) and directional icons hard-coded throughout the code.
Make ready for the right-to-left locales on .
- Audit the code for direction-dependent code, with file and line:
- web: physical CSS (
margin-left,padding-right,left,right,text-align: left,border-left,float, and corner-specific radii),translateXand directional animations,background-position, absolute positioning, and a missingdirorlangonhtml. - ios: left and right constraints instead of leading and trailing,
NSTextAlignment.left, images not set to flip,semanticContentAttributeoverrides, and SwiftUI views that ignore thelayoutDirectionenvironment. - android:
android:supportsRtlmissing, left and right attributes instead of start and end (Android Lint flags these asRtlHardcoded), and vector drawables withoutautoMirrored. - flutter:
EdgeInsets.only(left:),Alignment.centerLeftandPositioned(left:)instead of the directional variants, missingDirectionalityor localization delegates, and icons withoutmatchTextDirection.
- Decide mirroring for every icon and visual, in a table:
- Mirror back and forward arrows, chevrons, progress direction, list and indent icons, sliders, and "send" or "reply" arrows.
- Do not mirror media play and fast-forward, clocks and circular refresh, checkmarks, logos, brand marks, keyboard and code text, or icons showing a real-world object held in the right hand.
- Charts: time axes in RTL locales are a product decision; flag it rather than flipping silently.
- Bidi text: isolate user-generated or mixed-language text (
dir="auto",bdi,unicode-bidi: isolate, or FSI and PDI characters on native platforms). Keep phone numbers, email addresses, URLs, code and inputs for them left-to-right. Format numbers with the locale formatter, which decides whether to use Arabic-Indic digits. - Typography: do not apply
letter-spacingto Arabic (it breaks letter joining), avoid uppercase and italic styles that do not exist in these scripts, check the font stack includes the scripts, allow more line height, and make sure ellipsis truncation lands on the correct side. - Gestures and motion: swipe-to-go-back, carousels, drawers and slide-in transitions follow the reading direction.
- Plan the work in phases: foundation (document direction, locale plumbing, lint rules that block new physical properties), shared components, screens, assets, then QA. Give each phase an S, M or L effort and note its dependencies.
- Implement the foundation and the changes in . Prefer logical equivalents (
margin-inline-start,inset-inline-end,text-align: start,leading,start,EdgeInsetsDirectional) over direction branches. Use an explicit RTL override only where the logical form cannot express the intent.
- Do not flip the whole UI with a mirror transform.
- Left-to-right rendering must not change. Verify that each change renders the same in LTR.
- Translation is out of scope. Use a pseudo-RTL locale or the platform's force-RTL option for testing.
- Do only what was asked. If you notice something else worth changing, mention it in one line at the end instead of changing it.
- Keep the change as small as it can be while still being correct.
- Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
- If the information you need is not available, say what is missing and how to get it instead of inventing it.
Audit
| File:line | Issue | Fix |
Mirroring decisions
| Element | Mirror? | Reason |
Plan
Phases with effort, dependencies and a done-when line each.
Changes
A unified diff for the foundation and .
Test checklist
How to switch to RTL on (the dir attribute, the Xcode right-to-left pseudolanguage, Android's "Force RTL layout direction" developer option, or Flutter's Directionality override), plus the screens and states to compare in LTR and RTL screenshots.
1 required value still a placeholder; the assistant will ask for it.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- Localization (software)
- level
- Intermediate
- made for
- Frontend engineer, Mobile engineer
- needs
- repo-read, file-write
- risk
- edits-files
- version
- v1.0.0 · incubating
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install plan-rtl-support --target claude-codenpx skills add hermes-hq/hodios-dist --skill plan-rtl-support -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of Localization (software)Review code for internationalization bugs
Reviews code for internationalization bugs such as concatenated strings, hard-coded date, number and currency formats, naive plurals, text expansion and RTL breakage. Use before adding new locales.
review-i18n-readinessBuild a localization glossary
Builds a product term base from UI strings, with definitions, do-not-translate terms and proposed translations per locale, so localization stays consistent. Use before the first translation round.
build-localization-glossaryExtract hard-coded UI strings
Finds hard-coded user-facing strings and moves them into an i18n catalog with meaningful keys and translator comments, without changing behaviour. Use when preparing an app for translation.
extract-ui-stringsQA a translated string catalog
QA-checks a translated catalog against its source for placeholder mismatches, broken syntax, truncation risk, terminology drift and untranslated strings. Use before merging translations.
review-translated-stringsTranslate a software string catalog
Translates a software string file (JSON, PO, XLIFF, ARB, Android or Apple strings) keeping keys, placeholders, plurals and length limits intact. Use when localizing an app's UI text.
translate-string-catalogWrite ICU plural and select messages
Converts messages with counts, gender or choices into correct ICU MessageFormat for each target locale's plural categories, with test values. Use when strings depend on a number or gender.
write-icu-plural-messages