I18nManager
TheI18nManager module provides utilities for managing Right-to-Left (RTL) layout support for languages like Arabic, Hebrew, and others. It provides methods to control RTL behavior and check the current layout direction.
Examples
Change positions and animations based on RTL
If you absolutely position elements to align with other flexbox elements, they may not align in RTL languages. UsingisRTL can be used to adjust alignment or animations.
During Development
Reference
Properties
isRTL
isRTL is determined by the following logic:
- If
forceRTListrue,isRTLreturnstrue - If
allowRTLisfalse,isRTLreturnsfalse - Otherwise,
isRTLwill betruegiven the following:- iOS:
- The user-preferred language on the device is an RTL language
- The application-defined localizations include the user-chosen language (as defined in the Xcode project file (
knownRegions = (...))
- Android:
- The user-preferred language on the device is an RTL language
- The application’s
AndroidManifest.xmldefinesandroid:supportsRTL="true"on the<application>element
- iOS:
doLeftAndRightSwapInRTL
Methods
allowRTL() Android iOS
allowRTL(boolean): Whether to allow RTL layout
- Changes take effect on the next application start, not immediately
- This setting is persisted across app restarts
forceRTL() Android iOS
forced(boolean): Whether to force RTL layout
- Changes take full effect on the next application start, not immediately
- The setting is persisted across app restarts
- Only meant for development and testing. In production, you should either disallow RTL fully or handle it appropriately (see
isRTL)
swapLeftAndRightInRTL() Android iOS
isRTL.

