Skip to content
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

Switching languages on non-default branch goes to default branch #4490

Open
modelmat opened this issue Aug 8, 2018 · 6 comments
Open

Switching languages on non-default branch goes to default branch #4490

modelmat opened this issue Aug 8, 2018 · 6 comments
Labels
Feature New feature Needed: design decision A core team decision is required

Comments

@modelmat
Copy link

modelmat commented Aug 8, 2018

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,

@stsewd
Copy link
Member

stsewd commented Aug 8, 2018

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.

@stsewd stsewd added Feature New feature Needed: design decision A core team decision is required labels Aug 8, 2018
@humitos
Copy link
Member

humitos commented Aug 8, 2018

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)

@humitos humitos added this to the I18n improvements milestone Nov 15, 2018
@stsewd
Copy link
Member

stsewd commented Mar 6, 2019

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

https://github.com/rtfd/readthedocs.org/blob/4911600c230809bd6fb3585d1903121db2928ad6/readthedocs/core/templatetags/core_tags.py#L39-L43

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)

@humitos
Copy link
Member

humitos commented Mar 11, 2019

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.

@stsewd
Copy link
Member

stsewd commented Mar 11, 2019

We already jump between files when switching versions, even if the file gives 404.

@humitos
Copy link
Member

humitos commented Mar 12, 2019

That's my point. It's not a good UX clicking on a link and get 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants