Honour user's browser language preference
|Reported by:||spaetz||Owned by:|
A user accepting "klingon, de-de, de, it" will currently be served english web sites, as we try to serve the 1st choice and fall back to english if not available.
(WHY don't we have a klingon translation by the way???)
We need to fetch a list of available translations and match that up again the browsers accepted languages coming up with the best choice to use.
For this we can use 2 options: werkzeug.accepted_languages.best_match(['de', 'en']) which would be good, but probably is not sufficiently clever: initial test seems to show that preferred: "de-de, "en" available: "de", "en" would negotiate "en".
Alternatively there is "babel.negotiate" which seems to be cleverer and return "de" if preferred "de-de, en" and available "de, en".
Investigate and fix.