dougwollison / nlingual

Versatile and flexible multilingual system for WordPress.
https://wordpress.org/plugins/nlingual/
GNU General Public License v2.0
13 stars 7 forks source link

Translate based on user agent preference even if skip_default_l10n true #13

Closed notabeatle closed 4 years ago

notabeatle commented 4 years ago

Fixes #12

notabeatle commented 4 years ago

Specific behavior addressed:

1) Add a second language, after your default (say, en as default, fr as the second)

2) Make sure skip_default_l10n is set to false.

3) Visit "example.com/" with en as your browser's preferred language. Be redirected to "example.com/en/".

4) Visit "example.com/" with fr as your browser's preferred language. Be redirected to "example.com/fr/"

5) Set skip_default_l10n

6) Visit "example.com/" with en as your browser's preferred language. No redirection, English site displayed.

So far, so good!

7) Visit "example.com/" with fr as your browser's preferred language. No redirection, English site displayed.

That's the bad part.

With this change, 7) now redirects to "example/fr/" while the rest remains the same (as it should).

dougwollison commented 4 years ago

Impelementing my own patch to this due to some other changes I wanna make