-
Notifications
You must be signed in to change notification settings - Fork 25.1k
RTL language switch not working properly on android #54938
Copy link
Copy link
Open
Labels
Component: SwitchNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.
Metadata
Metadata
Assignees
Labels
Component: SwitchNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Platform: AndroidAndroid applications.Android applications.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
Seems to be caused by this PR: #53417
Locale.getAvailableLocales()[0]
This gets the first locale in the list of ALL available locales installed on the device, not the current/preferred language. This is incorrect.
It should be using one of these instead:
Locale.getDefault() – the system's default locale
context.resources.configuration.locales[0] – the app's current locale (respects per-app language on Android 13+)
Steps to reproduce
Set app local config with LTR and RTL langauge
switch to arabic language from app setting
open app, layout is still LTR, expexted to be RTL
React Native Version
0.82.1
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
N/A
Screenshots and Videos
No response