4 ms·
Question: Can you include two languages with the same level of preference in the Accept-Language header? The idea is that the website chooses which language (b
by diego_sandoval 2y ago
Question: Can you include two languages with the same level of preference in the Accept-Language header?
The idea is that the website chooses which language (between those two) to use.
- layer8 2y agoUnfortunately not. I’d really like to have the semantics of “the website’s native language if I understand it (if it’s one of A/B/C), otherwise English”. But nowadays it’s a clusterfuck anyway. You often get WebView-based apps were half of the UI uses the OS language, half the browser preference, and the third half the service’s native/local language.
- Cyberdog 2y agoThe Accept-Language header, when used properly, provide exactly the semantics you ask for.
- cdaringe 2y agoThere’s ambiguity in the spec in selection itself. f(a-l-input, supported-locales) yields different outputs contingent on what selector youre using, and its not incorrect
- Cyberdog 2y agoYes, but if the web site supports both of them, then it will pick whichever one is first in the header. For example, "en;q=1.0,de;q=1.0" technically states you want equal weight to be put on English and German, but the site has to pick one to show you, so it will most likely fall back to the behavior that's used when the quality score isn't provided (such as "en,de"), which is to pick the first one it can service from left to right.