android / android/nowinandroid
[Bug]: Text artifacts in RTL layout
- Dominant language
- Kotlin
- Stars
- 21.8k
- Forks
- 4.6k
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 2
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is there a StackOverflow question about this issue?
- [x] I have searched StackOverflow
### What happened?
When the device locale is set to a right-to-left (RTL) language such as Arabic, text in the app displays incorrectly: periods, question marks, and exclamation marks appear at the beginning of the last line in a text block instead of at the end.
I'm also thinking about whether the English should be aligned to the right, or maybe to the left. In the View system, when a `TextView` is `match_parent`, Android aligns the English to the left (based on the first strong directional character), regardless of the fact that device language is RTL.
Are there RTL language users who could share their expectations regarding English text alignment in RTL contexts?
**Android 14 emulator, Arabic locale**
https://github.com/user-attachments/assets/83798e63-badc-48d0-9a3c-1a2f0331d72c
### Relevant logcat output
```shell
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
No files, tests, or entry points are identified in the issue. Start by reproducing the text rendering on an Android 14 emulator with an Arabic locale, then trace the affected text block and its RTL behavior; done means punctuation renders correctly and the English-alignment expectation is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- internationalization, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100