How do I set the language setting of an iPhone OS device to a webpage?
I am trying to create a web page that can be viewed by an iPhone OS device. Is there a way to get the current language or some language specific data when the user visits the iPhone OS device? I want to set the language of the web page to match the local or language interface of the device. So how can I customize the language setting of an iPhone OS device to my webpage?
a source to share
The iPhone does send reasonably correct Accept-Language
, as you can see from this email .
(However, it is strange to me that it only sends fr-fr
. It is more reasonable to send fr-fr, en-us;q=0.9
and they may change to that in the future)
But more important to you is that you really don't need to do anything in your situation. This is called content negotiation and is a standard feature of Apache and other servers — they automatically return the page to their preferred language with minimal configuration.
You need to create different pages at different URIs for different languages. If you don't, you will violate the idea that any content has a URI that can be easily passed on to another person, and that the second person will see exactly the same content even if his / her language is different.
How Apache does it. You create
example.fr.html
example.en.html
example.de.html
(and edit the file .htaccess
). It then /example
returns the page in the user's language and /example.fr
always returns French. As an added bonus, you don't need it .html
.
a source to share