-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Explicitly declare app language and support per-app language preferences #6634
Conversation
Do we still need |
We should no longer need to specify If adding a new package is not desirable, I might need to update the current |
Let's remove that config then. |
Done. |
seems like there are some bugs in that package jakex7/react-native-localization-settings#10 |
It seems we won’t encounter this issue. Earlier when I reviewing the The language list file told to system which languages our app supports, enabling per-app language preferences. This allows users to set a specific language for each app without changing the system language. When calling It somewhat replaces the app’s built-in display language switching feature but provides a more native language-switching experience for users. I can’t say for sure what Bluesky’s future plans are, so per-app language preferences simply offer a possibility. Here’s a demonstration of per-app language preferences on Android. iOS also provides per-app language preferences feature in the system settings, with behavior identical to that on Android. example.mp4 |
Just to clarify, with this PR, does this mean both the system per-app setting and the in-app setting work? Which one takes precedence? It would help to know specific before/after behaviors. |
The system’s per-app language preferences only affect the value of |
I did some cross-checking today and here’s what I observed: A. When the user has never manually switched the display language within app, the system’s per-app language preferences always works. B. When the user has manually changed the display language within the app, the system’s per-app language preferences no longer apply, and only the within app display language setting takes effect. It seems to be related to |
So it seems confusing to allow configuring in system preferences if those aren't always 1:1 in sync with the app, right? How do other apps solve this? |
This is indeed confusing. I looked into some other apps, and as you mentioned, apps typically only choose one method for language switching. For example, apps like X and Mastodon, which support the system’s per-app language preferences, they don’t include an in-app display language settings. So yes, if the decision is to use the more native per-app language preferences, we should hide the in-app display language switch on native. The pros and cons are quite clear, because the web still need display language settings, If we do this, we will be maintain two sets of app language lists. But it would provide a better experience for native users, such as enabling more refined language support. Anyway, this is beyond the scope of this PR. I will close it and leave the idea here. Thank you so much for taking the time to work through this with me. |
Based #6567
It seems that
CFBundleLocalizations
is not the only factor affecting iOS when providing a localized text input context menu. According to this documentation, we also need to create aLocalization.strings
file to list the supported languages for the app.On Android, the system language settings determine the localized text input context menu, not by app’s declaration. But creating a language list file can enable per-app language preferences on Android.
By introducing this react-native-localization-settings package, we can generate the language list files for both Android and iOS, while it also performing additional tasks to compatibility with system APIs.
In the Chinese section of the language list, following up on #6621, I used the RFC 4646 standard, as both iOS and Android prefer it, and it also complies with IETF BCP 47.
This should fix #6162 again.