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

Issue with automatic redirect #9

Closed
lewislbr opened this issue Apr 7, 2019 · 2 comments
Closed

Issue with automatic redirect #9

lewislbr opened this issue Apr 7, 2019 · 2 comments

Comments

@lewislbr
Copy link

lewislbr commented Apr 7, 2019

Hi, first of all thanks for this plugin, I like the fact that allows a single page pull data rather than one page for each language.

Overall it works very well, creating pages for each language, but I'm having issues with the automatic redirect, as always goes to the default language, although I can change it later.

I'm looking for an automatic, non changeable option where it only shows the language based on the browser language like:

<script>
      let language = window.navigator.language;
      if (language == "es") {
        window.location.href = "/es";
      }
      if (language == "en") {
        window.location.href = "/en";
      }
    </script>

As adding the previous snippet to the helmet causes a load loop, is there a way to achieve it?

Thanks!

Repo: https://github.com/lewislbr/lewis-llobera-photography-gatsby

@wiziple
Copy link
Owner

wiziple commented Apr 7, 2019

Thanks for your report.
I also found this issue and fixed it on v0.1.7.
Please update your gatsby-plugin-intl.
Let me know if there's any other issue. 👍

@lewislbr
Copy link
Author

lewislbr commented Apr 8, 2019

Thanks, works great now! ✨

@wiziple wiziple closed this as completed Apr 8, 2019
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

2 participants