Open modelmat opened 5 years ago
It makes sense to me to stay on the same branch. We'll need to send the current branch to the footer API, I think we already have this information.
Just adding more context here to have the URLs hardcoded:
At https://discordpy.readthedocs.io/en/rewrite/faq.html (rewrite
version) the ja
link from the version menu points to https://discordpy.readthedocs.io/ja/latest/faq.html (latest
version) and it should points to https://discordpy.readthedocs.io/ja/rewrite/faq.html (rewrite
version --same as we were when clicking the link)
We can add the version in https://github.com/rtfd/readthedocs.org/blob/4911600c230809bd6fb3585d1903121db2928ad6/readthedocs/restapi/templates/restapi/footer.html#L21-L30
But, that is a function, we need to use this tag
But, we need to be careful with the performance when the project has a lot of versions.
And I think we already have some bugs related to the path that we should fix first (#4638)
The problem of linking to the specific version translated is that most of the docs do not have all the versions translated. So, in the end, we will be generating a lot of 404 for many projects also. I assume that's why we link to the "default version" instead.
We could add more logic here and "link to the same version only if that version exists in the translated project or fallback to the default version if not" but that won't work in the cases also, because the version may exists but the file does not.
We already jump between files when switching versions, even if the file gives 404.
That's my point. It's not a good UX clicking on a link and get 404.
Details
When switching the language from en to ja here it goes to the default branch here (which since it has no ja language goes back to en.
Expected Result
It stays on the same branch/version you were previously on
Actual Result
Switches to the default branch,