how to get Region format?

Mobile Safari: Is there a way for a web site to detect an iOS user's "Region Format"?

  • Trying to get the iOS device's: Settings > International > Region Format I looked at the environmental variables using: http://www.ranks.nl/rools/envtest.html But the closest I got was the HTTP Accept Language, and it only seems to update based on: Settings > International > Language So for instance, if I set "Language" to be English, and "Region Format" to be "Thailand", in the browser when I try to get "window.navigator.language", I just get "en-us". How can I get the Thailand part? Note, this is a web page, not a native app. Thanks!

  • Answer:

    You cannot get region info of a user, no matter if they are on desktop or mobile. All you can get is about what the browser reads OS information and sends to your website. I believe iOS Safari only sends you OS language in the browser for now. Your only chances are as you said HTTP Accept-Language header and navigator.language.

Ahmet Alp Balkan at Quora Visit the source

Was this solution helpful to you?

Other answers

iOS Safari only gives you the language information, not region. Your desktop browsers usually give the region as well. Just ran some tests with a desktop Chrome on a Mac (set on English + GB) and iOS Safari (set on English + GB) and the Accept-Language headers are the following: Chrome on Mac set on English + GB: en-GB iOS Safari set on English + GB: en-US (because it defaults to the standard locale) This is similar when you are for instance French Canadian. Accept-Language will return fr-fr.

Lee Provoost

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.