Detect language on server side instead of JS
This MR fixes #3204 (closed) and preserves behavior from #2899 (closed) by computing the user's preferred language on the server side. Logic is still the same:
- first, consider llnglanguage
- then, Accept-Language
- finally, fallback to "languages" / english
Moving everything to server-side avoids having duplicate logic (in two different programming languages), which could have been a future source of bugs.
Edited by Maxime Besson