I am currently working on a web application and I try to make the website multilingual. From The user I got the following things:
- language - from
$_SERVER['HTTP_ACCEPT_LANGUAGE']
- country - from the useres IP address (with an API)
Now, the website takes the language and shows the page in the correct language - for example english or german. Now I want to format numbers and dates and I dont know what should I use to format a date for example:
- Germany: dd.MM.yyyy
- United States: MM/dd/yyyy
But what should I use to format the date? The language or the country? What if a user is in the US but speaks german? Should I use the US or the german format?
Would be nice to hear your opinion about that and how you handle localization.