Repository navigation
Closed
Labels
Description
Feature Request
Summary
Add comprehensive RTL (Right-to-Left) support for Arabic and other RTL languages (Hebrew, Persian, Urdu) to improve accessibility and usability for users in RTL-speaking regions.
Motivation
OpenCode already has Arabic translations (README.ar.md and Arabic locale in the app), but the UI doesn't properly handle RTL text direction. This makes the interface difficult to use for Arabic-speaking users as text alignment, layout, and reading flow are incorrect.
Proposed Solution
1. Add Arabic Font Support
- Include IBM Plex Sans Arabic font (Regular, Medium, SemiBold weights)
- Use
unicode-rangein@font-faceto only load Arabic glyphs when needed - Add
--font-family-arabicCSS variable
2. Create RTL Stylesheet (rtl.css)
- Text direction and alignment rules for
html[dir="rtl"] - Preserve LTR for code blocks, file paths, URLs
- Icon flipping utilities for directional icons (arrows, etc.)
- Scrollbar positioning adjustments
- Form input RTL alignment
- Logical CSS properties (margin-inline-start, padding-inline-end, etc.)
3. Extend i18n Context
- Add
isRTLaccessor to detect RTL locale - Add
directionaccessor returning"ltr"or"rtl" - Auto-set
document.documentElement.dirwhen locale changes
4. RTL Utility Classes
.font-arabic- Explicitly use Arabic font.rtl-flip- Flip icons horizontally.preserve-ltr- Keep content LTR (for code).text-start/.text-end- RTL-aware alignment.ms-auto/.me-auto- RTL-aware margins
RTL Languages to Support
| Locale | Language |
|---|---|
ar |
Arabic |
he |
Hebrew |
fa |
Persian (Farsi) |
ur |
Urdu |
Implementation Notes
I have a working implementation ready that includes:
- 3 IBM Plex Sans Arabic font files (~224KB total)
fonts-arabic.csswith optimized@font-facedeclarationsrtl.csswith comprehensive RTL styling- Modified
i18n.tsxwith RTL detection helpers - Modified
language.tsxto auto-applydirattribute - RTL utility classes in
utilities.css
Files Changed: 12 files, +357 lines
Screenshots
The implementation correctly renders Arabic text right-to-left while preserving LTR for code blocks:
┌─────────────────────────────────────────┐
│ مرحبا بالعالم │ <- Arabic text aligned right
│ │
│ console.log("Hello") │ <- Code stays LTR
│ │
│ هذا نص عربي للاختبار │ <- More Arabic text
└─────────────────────────────────────────┘
Additional Context
- IBM Plex Sans Arabic is the Arabic companion to IBM Plex (already used in OpenCode)
- Uses
unicode-rangeso fonts only load when Arabic characters are present - No breaking changes - LTR languages work exactly as before
- Tested with standalone HTML and Vite dev server
Contribution
I'm happy to submit a PR with this implementation. Let me know if you'd like any changes to the approach!
Reacted by Yehuda, gai-qh, Yarden zamir, Amr Emad | AI Engineer, Mohamad Salah, abdulrahman bakrin, Seyyed Emad Razavi, Folaan and Behzad Haji Ahmadi
Activity
github-actions commentedon Jan 27, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your implementation addresses aspects not covered in these issues.
feat(i18n): Add RTL (Right-to-Left) support for Arabic and other RTL …
feat(i18n): Add RTL (Right-to-Left) support for Arabic and other RTL …
github-actions commentedon Mar 30, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
algonomadx-ux commentedon May 30, 2026
This issue is marked as closed, but RTL support still seems incomplete.
For Persian (Farsi):
Can the maintainers clarify whether RTL support was actually implemented, and if not, what is the current roadmap for it?
Thank you.
hussainbiedouh commentedon May 31, 2026
+1
hossamyosri commentedon Jun 6, 2026
not solved yet
legacymkr commentedon Jun 12, 2026
not solved
2-sa commentedon Jun 15, 2026
not solved
hussainbiedouh commentedon Jun 15, 2026
not solved
razavioo commentedon Jun 21, 2026
https://github.com/razavioo/opencode-rtl
I have created an
opencode RTL pluginthat solves the most part. feel free to check it out.nkhayatei commentedon Jun 24, 2026
I also have problems with Persian and Arabic.

orenmizr commentedon Jun 25, 2026
was this just ignored ? closed without reason ?
important to note to workaround won't work everywhere:
tested on apple terminal :
tested on warp (ghostty in core)
it matters which terminal you're on. ghostty also has rtl issue of its own: ghostty-org/ghostty#1442