react-native-i18n
react-native-i18n copied to clipboard
Language changing properly only after reopening the app
After changing language to Arabic all text data are automatically aligned to the Right side of the screen properly. But all other components like Icons are aligning only after re-opening the app.
export function langSet(type){
if(type == "en"){
I18n.locale = type;
const currentLocale = I18n.currentLocale();
}else{
I18n.locale = type;
const currentLocale = I18n.currentLocale();
ReactNative.I18nManager.allowRTL(true);
ReactNative.I18nManager.forceRTL(true);
}
}
@ajithes111 you need to restart the app for RTL aligning to take place. You can easily do that with https://github.com/avishayil/react-native-restart
Hey You just need to save your I18n.Locale in your Cache You can use Redux Persist or asyncStorage