Closed apancutt closed 8 years ago
Hey @apancutt
I see the problem you are having. For some background, forced redirects weren't implemented because a lot of people don't want to view the page in a forced language.
Consider for example an Englishman living in Spain being forced to read the site in spanish, or a Canadian being forced to read in French even though Canada is bilingual.
Nevertheless, a happy middle ground would be to allow for both non-forced and forced redirect. If you adjust your pull request so that a constant var forceRedirect
can be toggled true / and false accordingly, I'd be happy to merge it.
Sorry, I meant to cancel this PR when I deleted my fork.
I realise that your implementation is intended to mirror the behaviour of the WPML plugin, only using GeoIP instead of the browser settings. Further changes to the behaviour of your plugin would likely cause more implementation/maintenance issues than it's worth.
Instead, as our requirements substantially differ, we've gone for a custom plugin using GeoIP Precision Services and HTTP redirect headers instead of a JS implementation.
Thanks for responding, though.
Thanks, closing this.
Currently, the user is only redirected once per cookie lifetime.
A typical user journey:
This is a different experience to previous visit, which is confusing our users.
This patch will continue using cookies to cache the browser language but will always redirect when local content is available.