Reputation: 2362
If the user has set the device (ios) to a language that follows RTL how do I detect this in react native? I'm using the following to obtain the language.
NativeModules.SettingsManager.settings.AppleLanguages[0]
Upvotes: 0
Views: 2164
Reputation: 2214
You can use I18nManager
to check Right-to-Left.
First you should import I18nManager
from react-native
import {I18nManager} from 'react-native';
and then check isRTL constant
console.log("is RTL", I18nManager.isRTL);
You might also want to read this blog post about RTL in react-native: Right-to-Left Layout Support For React Native Apps
Upvotes: 2