JosefCevik / JWManagement

GNU Affero General Public License v3.0
57 stars 30 forks source link

Use browser's Accept-Language HTTP header to set default language #418

Open ssb22 opened 5 years ago

ssb22 commented 5 years ago

I don't know how easy it would be to do this in Meteor, but it would be nice when signing up new users to set their default language to the language specified by their browser's Accept-Language HTTP header, if we have such a language (otherwise en-US).

For example, my Android phone's Chrome browser sends the header:

Accept-Language: en-GB,en-US;q=0.9,en;q=0.8

and if JWManagement were to respond to this by setting the language to en-GB (instead of its default en-US), then we wouldn't have lots of British users being slightly confused that dates are written the American way (month before day) instead of the way we're used to (day before month).

If this is too difficult, would it at least be possible to change the name of the "Language" option into "Language and Region" or perhaps even "Language & date format". because British people tend not to think of exploring an option called "Language" (they'd think "my language is English, and it's already showing English; I don't want it to show French or German instead of English, so why should I tap on Language?")—they tend not to realise that "Language" will contain an option for en-GB (not just en-US) and that this affects the date format also.

Another possible solution might be to display the language selector on every new sign-up, so the new user MUST select a language. Most British people will tap "en-GB" rather than "en-US" if the choice is put in front of them, but they won't go looking for it under an option called "Language" because they don't expect support for both to be there.