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 selector does not keep the current page but goes to the root of the website #10045

Open
aleene opened this issue Mar 28, 2024 · 1 comment

Comments

@aleene
Copy link
Contributor

aleene commented Mar 28, 2024

What

A product page can often been seen in multiple languages. A drop-down menu allows to change the language of the page.

Steps to reproduce the behaviour

  1. Go to https://hr.openfoodfacts.org/product/4020400898638/di-erbe-caramelle-vivil
  2. Click on hrvatski to change to english
  3. A main page is shown and not the product page in english

Expected behavior

A page in english

@hangy
Copy link
Member

hangy commented Mar 28, 2024

It works as implemented. 😅 Currently it's implemented to always go to the main page.

Because of the internationalized path parts, it's not easy to do. If we know that we're on a product page, then we could just assume that the English product will work, but if we're ie. on a 3rd level facet like https://jp.openfoodfacts.org/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA%E3%83%BC/%E9%A3%B2%E6%96%99/%E3%83%A9%E3%83%99%E3%83%AB/eu%E3%82%AA%E3%83%BC%E3%82%AC%E3%83%8B%E3%83%83%E3%82%AF/%E3%83%A9%E3%83%99%E3%83%AB/en:pure-juice it gets more complicated as we need some canonical value available to build the URL in the "new" language. We already create a rel="canonical" URL, so adding that metadata somewhere should be possible.

@teolemon teolemon added 🐛 bug This is a bug, not a feature request. language switcher labels Mar 29, 2024
@stephanegigandet stephanegigandet changed the title Language selector does not work Language selector does not keep the current page but goes to the root of the website Apr 4, 2024
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@teolemon teolemon removed the 🐛 bug This is a bug, not a feature request. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants