Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iOS 15.5 / 15.6 mobile safari navigator.language is not correct

Hi there,


Canada Locale for navigator.language comi… - Apple Community


I am facing a strange behavior (like the issue discussed above) on all browsers running on iOS. It looks like the provided navigator.language locale is just wrong. It does select the correct language but not the regional code. For example if I select the language german - Switzerland, it returns de-DE which is german - Germany, expected result would be de-CH. Is this a bug?


I tried to change regional settings and formats but this isn't considered by the browser as well.


Thx for any hints

Posted on Jul 29, 2022 7:11 AM

Reply
3 replies

Jul 31, 2022 8:19 AM in response to Chris7811

Hi Chris7811,



Welcome to Apple Support Communities. We want to help, but we need some clarification. Where are you trying to make these changes on your iPhone? The specific setting will help us with the next steps.


Did you first notice this after installing iOS 15.5?


Let us know and we will do our best to assist.


Cheers!

Aug 5, 2022 6:17 AM in response to Lager1

Hi there,


Thx for your question. I am happy to provide details. So Safari (and maybe other browsers) takes the locale (visible on every webpage on dom object navigator.language) from its iOS Safari app setting (Settings -> Safari -> Language). There they write "Safari will use the first language that it supports from Language & Region settings. You can select diffrent language for Safari to use if you prefer".


Now, there is no option to deselect the Safari Language Setting. I see "Suggested Languages" and one is selected. And all languages I can select (the list is limited - not all languages and regions are there), I can't find "German - Switzerland" like for example Englisch (UK). And this matters, cause a web site want to provide correct data, for example number formats.


As said before, the selection is set and it sounds like it is optional to select one. But there is no possiblity to deselect any language or much better just an option like "Use System Language & Region Setting".

Aug 5, 2022 7:57 AM in response to Lager1

And a bit deeper: In addtition to the dom navigator.language property, the browser also sends the locale to the server as "HTTP_ACCEPT_LANGUAGE". This property takes the language code from "General -> Language & Region" setting, ignoring the Safari Settings at all. Sounds good, but here also the locale is wrong since the Region selection is completely ignored.


I guess to biggest problem with the "General -> Language & Region" is that people select a region to have the formats ("Live Text") they want to have. So in my region people select "German" and region "Switzerland" and the live text is correct formatted. Safari ignores the region and sends "de-DE" and this reults in diffrent formats on every website.


Now, I know that there is a language "Schwiizertüütsch" (translation would be swissgerman) which is funny because it is written like we speak it, but unless one knows that only this language will result in correct formats (sends valid locale 'gsw-ch'), one will not select it - because we are very used to select german as a written language AND people are scared, that they then are forced to read everything displayed in written swissgerman (believe me, noone wants that).


My suggestion to Apple: Make it very clear that region settings are ignored by browsers and apps built on browsers and or add a language "German (Switzerland)" like the already existing languages "German (Austria)" and "German (Germany)".



iOS 15.5 / 15.6 mobile safari navigator.language is not correct

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.