-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect user's preferred language from Accept-Language header and switch to that language if available #4600
Comments
This is more closely represents an operations issue, so paying a third party won't really help us get this implemented. It's not quite on our roadmap, though I have been pushing to focus on more i18n support, so I'm generally 👍 on an improvement like this in the short term. We have a few issues open already regarding similar changes (some in our private operations provisioning), but to summarize what redirects we are looking at:
|
Also, note that none of these changes happen in this code base, so I'll likely close this issue. We're tracking work internally though. |
Just came across this reference from Google relating to best practices for multilingual versions of pages in order to ensure proper indexing. In short, |
@agjohnson Hi! I just wanted to see if anything ever happened with the first change you suggested (looking at the accept language header). |
I'm going to reopen this one, as we were tracking changing this at our infrastructure level, but since 2018, we moved much of this handling away from Nginx and back into our application. I'd still like to see this done, but haven't quite lined up figures for how beneficial this is to readers overall. I can say that ~50% of our traffic is This will be somewhere on our backlog for now, we aren't focusing heavily on i18n efforts currently. But if someone wants to try this out, the code is relatively isolated and moderately easy to test as well: https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/proxito/views/serve.py |
Also, thinking about this more, this is maybe a good case for a redirect rule type perhaps? I could see how this would maybe be easiest as a Proxito resolver addition though. A redirect rule would avoid the trouble we'd have implementing this at a broad level, across all projects. Projects could opt in to the redirect rule if they need/want. A couple of constraints/issues I sense with this approach:
|
Read The Docs should check the
Accept-Language
header in the user's http request and attempt to display a localized version of the documentation, if a matching language is available. This would ideally be paired with an implementation of a language switcher as described in readthedocs/addons#250 so an override cookie could be set if the user manually selects a language.As mentioned in readthedocs/addons#250 I am prepared to pay a bounty for this work, or alternatively have already sourced a willing developer who can fork the appropriate repository. Also, it seems that readthedocs.org itself already implements language detection and a language switcher, could this be recycled? Thanks guys!
The text was updated successfully, but these errors were encountered: