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

Language switching redirects to home page instead of the current page's translation #1628

Open
Hyrla opened this issue Nov 8, 2024 · 4 comments
Labels
Bug A bug

Comments

@Hyrla
Copy link

Hyrla commented Nov 8, 2024

Problem

Since migrating to Sphinx RTD Theme 3.0, switching language redirects the user to the doc's home page instead of displaying the current page's translation. This used to work properly on 2.0.

Reproducible Project

Example page: https://esieabot.readthedocs.io/fr/latest/assemble/esieabot/esieabot-2024/esieabot-2024.html (the issue is the same with every page)

Expected Results

I am expecting to display current page's translation when switching language, like it used to be. Is there a new setting to mitigate that?

Environment Info

  • Python Version: 3.12
  • Sphinx Version: 8.3.1
  • RTD Theme Version: latest (3.0.1)
@Hyrla Hyrla added Bug A bug Needed: replication Bug replication is required labels Nov 8, 2024
@humitos
Copy link
Member

humitos commented Nov 8, 2024

Isn't this issue a duplicated of #1621?

@Hyrla
Copy link
Author

Hyrla commented Nov 8, 2024

Isn't this issue a duplicated of #1621?

I am sorry if my issue is not clear. It is a different issue here. Previously, if I switched language while I am reading a page in French, I was redirected to the same page in English (it's the same URL, but /fr/ was replaced by /en/). With the last version, switching language redirects to the home page instead of the current page translated in another language.

@humitos humitos removed the Needed: replication Bug replication is required label Nov 11, 2024
@humitos
Copy link
Member

humitos commented Nov 11, 2024

Gotcha, thanks for the extra details.

It seems we will need to replicate the chunk of code we added to addons that reads the readthedocs-resolver-filename META tag and appends it to the link:

https://github.com/readthedocs/addons/blob/0f025e3bf604f96506aebf2af120b4c20d02fde8/src/utils.js#L211-L241

@Hyrla
Copy link
Author

Hyrla commented Nov 11, 2024

Thank you. Do you need any more details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

2 participants