2 ms·
In theory the Accept-Language header should be enough to get the behavior you want, but of course that requires every single server to implement support, so in
by yorwba 3y ago
In theory the Accept-Language header should be enough to get the behavior you want, but of course that requires every single server to implement support, so in practice many sites will keep redirecting you to a different version based on IP geolocation.
But <link rel="alternate" hreflang="..." href="..."/> tags are pretty common for SEO, so maybe an extension could parse those to check whether you would prefer one of the other versions.
- pif 3y ago> In theory the Accept-Language header should be enough No, it is not enough, because there is no way to tell: "Pick the source in my 3rd language rather than the translation in my 1st language".
- Hackbraten 3y agoI use the Accept-Language per site add-on [1] for this. It allows me to map top-level domains to preferred languages. Most of the time, this has worked well for me on sites which respect the header. For example, `.de` sites tend to be originally written in German, so I map the `*.de` pattern to the German language. [1]: https://addons.mozilla.org/en-US/firefox/addon/accept-language-per-site/ https://addons.mozilla.org/en-US/firefox/addon/accept-langua...
- samus 3y agoThe browser UI is missing. There might be extensions that scratch that itch.
- iggldiggl 3y ago> In theory the Accept-Language header should be enough to get the behavior you want… I don't think so. Accept-language doesn't allow you to differentiate between high quality and low quality content in the same language. With accept-language you could say that you prefer Italian or French over English where available, but that means you might also be served a crappy Italian/French machine translation on occasion, even though in that case you'd have preferred the English text. (Microsoft for example seems to honour the accept-language header when looking at its documentation pages, but unfortunately that means that by default I get served the German page, which quite likely feels somewhat off due to having been machine-translated.)
- supriyo-biswas 3y agoThere’s the Q factor in the Accept-Language header that allows you to indicate your preference for the quality level of the translation. In practice, however, it is difficult to obtain such a quantification. Further, if you could quantify the translation, you can also just improve them instead.
- iggldiggl 3y ago> There’s the Q factor in the Accept-Language header that allows you to indicate your preference for the quality level of the translation. ??? The q factor is just for ordering the language preferences from top to bottom (i.e. it doesn't matter whether I write "de,en;q=0.8" or "en;q=0.8,de" because both of them mean that I prefer German over English because German is implicitly q=1.0 and en is explicitly only q=0.8) and doesn't say anything about the quality of the content.
- yorwba 3y agoThey're called quality values because they're intended to negotiate the tradeoff between different ways to serve the same content in different formats of varying quality, e.g. highly compressed JPEG with artifacts vs lossless PNG. Applying this to Accept-Language, "de,en;q=0.8" means "I prefer German content unless it's less than 80% as good as the English alternative." Of course in practice servers tend to treat all content they have as quality 1 and all content they don't have as quality 0 and then the lovingly crafted fractional quality values collapse to a simple ordered list. ("We serve what we have and you eat what you get.")
- jazzyjackson 3y agoI had to check the standard [0] on this and there seems to be some ambiguity, maybe simply with usage vs intent. The MDN entry states it is simply priority or preference [1] "12.4.2. Quality Values The content negotiation fields defined by this specification use a common parameter, named "q" (case-insensitive), to assign a relative "weight" to the preference for that associated kind of content. This weight is referred to as a "quality value" (or "qvalue") because the same parameter name is often used within server configurations to assign a weight to the relative quality of the various representations that can be selected for a resource." [0] https://www.rfc-editor.org/rfc/rfc9110.html#quality.values https://www.rfc-editor.org/rfc/rfc9110.html#quality.values [1] https://developer.mozilla.org/en-US/docs/Glossary/Quality_values https://developer.mozilla.org/en-US/docs/Glossary/Quality_va...