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

Previous pages not being refetched with correct locale when user changes the locale on current page and goes back to those previous pages #1007

Closed
3 tasks done
Dacaramo opened this issue Apr 19, 2024 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@Dacaramo
Copy link
Contributor

Dacaramo commented Apr 19, 2024

Description

When going back to the previous browser's history pages, those pages are not being refetched with the correct locale once the user has changed the locale of the website on the current page.

Maybe this is is the intended behavior, but it shouldn't: Why in the world an user that changes the language on my website and go back to the previous pages would want those pages to display on the previous language and not the language that he actually wants?

Verifications

  • I've verified that the problem I'm experiencing isn't covered in the docs.
  • I've searched for similar, existing issues on GitHub and Stack Overflow.
  • I've compared my app to a working example to look for differences.

Mandatory reproduction URL

https://www.ramzeis.com

Reproduction description

I'm following all of the steps on the navigation section docs.

I'm navigating between my pages using both the <Link/> component and the useRouter() router extracted from the object returned by the createSharedPathnamesNavigation function. After navigating FORWARD to any page, either by clicking on components or changing the url using the browser's search bar, everything works as expected:

  • The new locale is succesfully being inyected onto the target url when the user chooses the new language he wants
  • The NEXT_LOCALE cookie is succesfully changing to the new locale.
  • The pages are picking the correct locale and are being rendered with the correct translations

But when navigating BACKWARDS, when clicking on the browser's back button, every page of the history will completely ignore the NEXT_LOCALE cookie and will render it's content on the previous locale language and not the new one. No new requests are being made when going back to those pages.

Expected behaviour

When navigating backwards the pages must be refetched if the NEXT_LOCALE cookie has changed an use that locale.

@Dacaramo Dacaramo added bug Something isn't working unconfirmed Needs triage. labels Apr 19, 2024
@amannn
Copy link
Owner

amannn commented Apr 22, 2024

I appreciate the report, but this has been discussed before and works as intended: #700.

@amannn amannn closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants