-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat: add android open app language settings #288
feat: add android open app language settings #288
Conversation
@zoontek Please let me know if you welcome this addition before changing the readme |
@itsramiel Thanks for the PR! LGTM, except maybe one small thing: Could you update the method to return a For unsupported platforms / versions, it should reject with an error: |
I just updated it throw an error similar to |
@itsramiel I'm not a fan of throwing exceptions, if those are not handled, the app will crash, so it's actually even worse 😅 In a perfect world, everyone would use a Someone not reading the documentation (trust me, this happen a lot) will naturally add a catch block and display a generic error, which is better than a crash or no user feedback. |
@zoontek so basically make the function async to turn it into a promise and thats it? |
@itsramiel Yes |
Done |
b87692a
to
029c15e
Compare
Perfect, thanks! |
@itsramiel Released with v3.4.0 |
Thank you 🙏 |
Summary
The changes adds the capability to navigate users of the app to the language settings of the app for Android. It is not possible on iOS, macOS, and web afaik. An alternative solution would be use react native's
Linking.openSettings()
but this only opens the app settings and then the user has to look for theLanguage
option which can take some time and be frustrating to the user. Instead, this function directly leads to the language selection.The solution is implemented following the docs.
Test Plan
The changes can be tested using the example project in the repo. Below is a screen recording showing how it behaves.
Note that the per app language is available on api >= 33 and the app has to be setup to support multiple language as was done for the example project with the
locales_config.xml
file and the changes made to the manifest.Screen.Recording.2025-01-08.at.12.31.54.PM.mov
What's required for testing (prerequisites)?
Android device with api level >= 33 and has custom languages set
What are the steps to test it (after prerequisites)?
Call the newly exposed method
Compatibility
Checklist
README.md
example/src/App.js
)