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 reset when going back to the main URL #25

Open
esadrian opened this issue Sep 28, 2021 · 3 comments
Open

Language reset when going back to the main URL #25

esadrian opened this issue Sep 28, 2021 · 3 comments

Comments

@esadrian
Copy link

If the main URL automatically loads in Spanish and you choose English on the menu, when you go back to the main URL, it sends you back to Spanish.

I think this is because it is passing through redirect.njk again and sending the user to the browser language. So, it should store the current language (the one the user chooses) in a cookie, or something alike.

@ysahnpark
Copy link
Contributor

Yes, you are right.
I try to avoid using cookies as some people disable cookies for privacy purpsoe.
The other alternative is to set a property, say "homeUrl" in es.json and use it in the template. I will see if that do the trick.

Supongo que hablas espanol.
Si tienes mas ideas de mejora, me avisas.
Saludos.

@Dexus
Copy link
Contributor

Dexus commented Feb 11, 2022

I think a simple href="{{ '/'+locale+'/' | url }}" in top-nav.njk for the page link would do it.

another variant is to store the locale to the sessionStorage and request against it

@Dexus
Copy link
Contributor

Dexus commented Feb 11, 2022

see #29

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

No branches or pull requests

3 participants