This content originally appeared on DEV Community and was authored by Med Ahmed
Hello everyone,
I’m facing a challenge with my e-learning mobile application developed using React Native.
The Problem:
The app’s main language is English (i.e., the interface, menus, settings, etc.).
However, the app hosts courses in both English and Arabic.
When users open an Arabic course, the layout remains left-to-right (LTR), which makes it uncomfortable to read Arabic content.
I tried changing layout direction manually, but it affects the entire app instead of just the course content.
What I Want:
I want the app to keep the interface in English (menus, settings, etc.),
BUT when a user opens an Arabic course, the layout of that screen (course content only) should switch to RTL automatically.
Similarly, if they open an English course, the layout should remain LTR.
Questions:
Is there a way in React Native to dynamically switch layout direction (LTR/RTL) based on content language only for a specific screen or component?
Do I need to use a specific library like i18n, react-native-localize, or should I manually handle layout direction using styles?
What’s the cleanest and most scalable way to achieve this behavior?
Any help or guidance will be greatly appreciated!
Thank you in advance.
This content originally appeared on DEV Community and was authored by Med Ahmed