claude-code - 💡(How to fix) Fix [Feature Request] RTL (Right-to-Left) Language Support for Arabic, Hebrew, Persian, and Urdu [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49611Fetched 2026-04-17 08:36:16
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Code Example

/* Before */
margin-left: 10px;  /* LTR only */

/* After */
margin-inline-start: 10px;  /* Works for both RTL and LTR */
RAW_BUFFERClick to expand / collapse

Problem Statement

Claude Code needs better support for Right-to-Left (RTL) languages, particularly Arabic. Currently, the chat interface and text handling are optimized for LTR (Left-to-Right) languages.

Problem

Users working with Arabic language face several issues:

  • Chat interface does not properly reflect RTL text direction
  • Text appears in incorrect orientation
  • Poor visual alignment for Arabic characters and words
  • User experience is compromised when switching between Arabic and English

Expected Behavior

  • Full RTL support in chat interface when Arabic is used
  • Proper text directionality detection based on language
  • Correct character rendering and spacing for Arabic
  • Seamless switching between LTR and RTL languages
  • Interface elements should adapt to text direction

Current Behavior

  • Chat interface remains LTR regardless of language input
  • Arabic text may display incorrectly
  • No automatic RTL detection or adaptation

Proposed Solution

1. Frontend Implementation

  • Add dir="rtl" attribute to chat container when Arabic is detected
  • Implement CSS logical properties (margin-inline, padding-inline) instead of left/right
  • Use CSS flexbox/grid with proper alignment for RTL
  • Add language detection using Accept-Language header or user settings

2. Text Direction Detection

Auto-detect language and apply appropriate direction:

  • Arabic, Hebrew, Persian, Urdu → RTL
  • English, French, Spanish, etc. → LTR
  • Allow manual override in user settings

3. CSS Updates

Replace hardcoded left/right with logical CSS properties:

/* Before */
margin-left: 10px;  /* LTR only */

/* After */
margin-inline-start: 10px;  /* Works for both RTL and LTR */
  • Ensure icons and UI elements flip correctly in RTL mode
  • Test responsive design for RTL layouts

4. Typography & Font Support

  • Add support for Arabic fonts (e.g., Segoe UI, Arabic Typesetting)
  • Ensure proper character spacing and ligatures
  • Support for diacritical marks (tashkeel) in Arabic

5. Message Alignment

  • User messages: Right-aligned in RTL, left-aligned in LTR
  • Assistant messages: Left-aligned in RTL, right-aligned in LTR
  • Preserve code block formatting regardless of direction

6. Input Area

  • RTL text input field with correct cursor behavior
  • Support for mixed LTR/RTL text (bidirectional text handling)
  • Proper placeholder text direction

7. Accessibility

  • Ensure WCAG compliance for RTL layouts
  • Proper lang attribute in HTML
  • Screen reader compatibility for RTL content
  • Keyboard navigation support

8. Browser Compatibility

  • Test on: Chrome, Firefox, Safari, Edge
  • Ensure consistent rendering across browsers
  • Mobile browser support (iOS Safari, Chrome Mobile)

Use Cases

  • Arabic-speaking developers using Claude Code
  • Teams working on Arabic projects or documentation
  • Multi-language projects requiring seamless code assistance

RTL Support Required For

  • Arabic
  • Hebrew
  • Persian/Farsi
  • Urdu

Priority

Critical — blocking productive use for RTL language users

extent analysis

TL;DR

Implementing RTL support in Claude Code requires adding the dir="rtl" attribute, using CSS logical properties, and auto-detecting language direction to ensure proper text rendering and alignment for Arabic and other RTL languages.

Guidance

  • Add dir="rtl" attribute to the chat container when Arabic or other RTL languages are detected to ensure correct text direction.
  • Replace hardcoded left/right CSS properties with logical properties like margin-inline-start and padding-inline-start to support both LTR and RTL layouts.
  • Implement auto-detection of language direction using the Accept-Language header or user settings to apply the appropriate text direction.
  • Test the implementation on various browsers, including Chrome, Firefox, Safari, and Edge, to ensure consistent rendering and accessibility compliance.

Example

/* Before */
.chat-container {
  margin-left: 10px;
}

/* After */
.chat-container {
  margin-inline-start: 10px;
}

Notes

The proposed solution requires thorough testing for different languages, browsers, and devices to ensure seamless support for RTL languages. It's also essential to consider accessibility features, such as screen reader compatibility and keyboard navigation support.

Recommendation

Apply the proposed workaround by implementing the dir="rtl" attribute, using CSS logical properties, and auto-detecting language direction to provide full RTL support in the chat interface. This approach will improve the user experience for Arabic and other RTL language users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING