Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language.setLanguage() function is not updating the language with out rerender the component ? #221

Open
omarabualhija opened this issue Apr 15, 2023 · 1 comment

Comments

@omarabualhija
Copy link

omarabualhija commented Apr 15, 2023

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",

@shintiazhou
Copy link

Please check out this solution, you need to add dummy setState @omarabualhija

e.g : setDummyState({})
Check this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants