In the i18n.module under the _i18n_get_lang function, there is a bug.
This function is supposed to determine what language to get by checking this order:
* 1. Path language
* 2. User language
* 3. Browser language
* 4. Default language
When it comes down to number 4, there is this line of code:
$i18n_lang=key($languages);
...which just seems to grab the first language in the $languages array, even though it should be grabbing the website's default language. So, sometimes it'll work, sometimes it won't.
Basically, you just need to check the locales_meta table to get the actual default language and return that.
This bug is noticeable when visitors go to your front page (the language isn't in the URL path), and when you don't have the browser detected.
Comments
Comment #1
jose reyero commentedYest, that was an evil bug causing lots of other troubles.
Thank you.
Comment #2
(not verified) commented