forkcms/forkcms — pull request #269 by AAtticus (2012-05-09 09:42:54+00:00)
Title: Better language detection

"Accept-Language is a list of weighted values (see q parameter). That means just looking at the first language does not mean it’s also the most preferred; in fact, a q value of 0 means not acceptable at all.

So instead of just looking at the first language, parse the list of accepted languages and available languages and find the best match"

Insights: Gumbo at StackOverflow.

Implementation in Fork CMS so it no longer just looks at the first match but at the match with the highest q value.