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

Default to the system UI language #2612

Open
gnprice opened this issue Jun 2, 2018 · 3 comments
Open

Default to the system UI language #2612

gnprice opened this issue Jun 2, 2018 · 3 comments
Labels
a-i18n Translation, localization, internationalization help wanted

Comments

@gnprice
Copy link
Member

gnprice commented Jun 2, 2018

I haven't gone and confirmed this empirically (it's a bit annoying to test because it involves uninstalling the app), but from studying our code it looks like we always start out with English for the UI when the app is installed.

We should instead look at the user's language preferences they've set in the system settings, and respect those.

Once we've first installed, we can remember the language and let the user change it through our own settings UI independent of the system settings, like we do now. But this should make our language-settings UI unnecessary for the vast majority of users, and give most non-English-speaking users a better experience right from the start.

See also #2611 about some of the limitations of that UI; but no matter how excellent we make it, it'll be better still to make a sensible choice from the beginning.

@shubhsherl
Copy link

Hey, I would like to work on this issue? Can you guide me with this?

@chrisbobbe chrisbobbe added the a-a11y Accessibility label Feb 25, 2020
@rk-for-zulip rk-for-zulip added a-i18n Translation, localization, internationalization and removed a-a11y Accessibility labels Apr 17, 2020
@gnprice
Copy link
Member Author

gnprice commented Apr 16, 2021

I believe @im-adithya is working on this -- see chat thread.

@gnprice
Copy link
Member Author

gnprice commented Oct 12, 2022

We've had a user request in this area: chat thread.

For anyone interested in picking this issue up, here's the implementation discussion from that previous thread in 2021:

And great, that [library] returns a list of locales ordered by preference:
https://github.com/zoontek/react-native-localize#getlocales
So we should just go down that list and take the first match.

That leaves a few wrinkles:

  • If we have the country-specific variant that react-native-localize tells us the user prefers, then take that. If not, but we have the country-independent version, then take that.
    • This way, if e.g. the user prefers pt_BR aka "Portuguese (Brazil)", we'll give them pt. But if they prefer pt_PT, we'll give them that, which we also have.
  • [I believe this has since been made moot, but:] We have id_ID (actually we call it id-ID?), but not simply id. That error seems to originate in our Transifex config. We should try to straighten it out there (file an issue in zulip/zulip?); in the meantime, just add a line or two of code to work around it ad hoc.
  • Chinese is a bit different, because aside from per-country variations there are two different scripts (each of which is used in several countries); currently we have zh-Hans and zh-Hant which are the two scripts. (After i18n: Offer zh_TW instead of zh-Hant. #4285 it'll be zh_TW and zh-Hans.)
    • Not sure how react-native-localize will represent that. This will need testing -- select Chinese in your system language settings and find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-i18n Translation, localization, internationalization help wanted
Projects
None yet
Development

No branches or pull requests

4 participants