ReactNativeLocalization
ReactNativeLocalization copied to clipboard
language.setLanguage() function is not updating the language with out rerender the component ?
i'm trying to update my language using Language.setLanguage("ar") but the language is not change
What I'm trying to do :
//return 1 for English Lang or 2 for Arabic Lang ` let selectedLang =await AsyncStoregApp.getDate(CONSTANT.AsyncStorageKey.Lang,); if (selectedLang === 2) { LANGUAGES.setLanguage('ar'); I18nManager.allowRTL(true); I18nManager.forceRTL(true); } else { LANGUAGES.setLanguage('en'); I18nManager.allowRTL(false); I18nManager.forceRTL(false); }
packege.json
"dependencies": { "@react-native-async-storage/async-storage": "^1.17.12", "react": "18.2.0", "react-native": "0.71.4",
Please check out this solution, you need to add dummy setState @omarabualhija
e.g : setDummyState({})
Check this out