For a website we're about to implement automatic country/language selection, but still giving the user the choice to change it.
First of all, if the user enters the website using a domain with a country-level TLD they will be presented the correct language by default. But the question is what should the logic be if they come from generic/international TLD such as .com. Should we prefer using the country we get through their IP address or should we use their browser locale? If both, in which sequence?
As such, I was thinking of this hierarchy:
As most countries have several official languages you should rely first on user preferences and then on browser locale, TLD, IP and then english as 'default' (or any major language of your main user base)