• Hi,

    I have setup Polylang so the language can be changed in primary menu.

    • I have set default language to English.
    • All my blog posts except two are set English. the last two blog posts are set to Danish.
    • All pages are set to English.
    • I have unchecked “when the front page is visited, see the language according to browser preference”.
    • I have checked “The language is set from Conttent, post pages…”
    • I have cleared all cookies in Firefox.

    Now, the following happens.

    Firefox visits “http://example.com”: English shown
    Firefox clicks “Danish” menu button and is taken to http://example.com/da/”

    If I then try click on “English” again which should take me to http://example.com I am instead redirected to http://example.com/da/

    No matter what I do except clearing cookies in Firefox I can not switch to English / see any pages/posts in English.

    I can not duplicate this problem on Chrome or IE.

    GET / HTTP/1.1
    Host: example.com
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: da,en-us;q=0.7,en;q=0.3
    Accept-Encoding: gzip, deflate
    Cookie: __cfduid=d4d9137c7014d7114e3fe5ac353182ec31385046457137; bb2_screener_=1385048412+00.00.000.000+00.00.000.000; pll_language=da; __qca=P0-960969138-1385046458610; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_c8ddc5ae9d7fbe55c00448ff21f73c65=admin%7C1385219487%7C60d7a15650a79f2e2c559b61d3f93b01; PHPSESSID=8a2a65b4395ee621f862e40b4ac5d83e; wp-settings-2=editor%3Dhtml; wp-settings-time-2=1385046689
    DNT: 1
    Connection: keep-alive
    
    HTTP/1.1 302 Moved Temporarily
    Server: cloudflare-nginx
    Date: Thu, 21 Nov 2013 15:40:55 GMT
    Content-Type: text/html; charset=UTF-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    X-Pingback: http://example.com/xmlrpc.php
    Expires: Wed, 11 Jan 1984 05:00:00 GMT
    Cache-Control: no-cache, must-revalidate, max-age=0
    Pragma: no-cache
    Set-Cookie: bb2_screener_=1385048454+00.00.000.000+00.00.000.000; path=/
    Location: http://example.com/da/
    CF-RAY: d0e7b259b0f05b5

    http://wordpress.org/plugins/polylang/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Chouby

    (@chouby)

    What is your Polylang version?

    Thread Starter comsys13

    (@comsys13)

    It is version 1.2.3

    Plugin Author Chouby

    (@chouby)

    Could you post a link?

    Thread Starter comsys13

    (@comsys13)

    Plugin Author Chouby

    (@chouby)

    I don’t reproduce (with Firefox). I suspect that you still have a cookie problem (there was such bug introduced in 1.2 and corrected in 1.2.2). You should try removing all cookies.

    Thread Starter comsys13

    (@comsys13)

    Hi,

    Thanks for trying to help (!)

    I already tried clearing the cookies in FireFox. And while it is true that solves the problem, the problem returns next time I click on the button that selects Danish as language 🙁

    Without having seen the code, could it be the combination of the cookie + Firefox requesting Danish in its headers?

    Plugin Author Chouby

    (@chouby)

    I tried with the same browser language preferences as you but still don’t reproduce the problem. The browser language preference is used only when there is no cookie present (and only if you check the relevant option in Polylang settings).

    Just to be sure that we test the same thing. Your problem is when you click on the “English” item. Not when you type the url http://misvblog.com in the address bar (in that case it is intentional that you come back to the last browsed language: Polylang uses referrer detection to differentiate the the two cases).

    How do you clear the cookie? Do you delete only one or all?

    Thread Starter comsys13

    (@comsys13)

    The way I clear cookies in FireFox is simply to remove them all in FireFox cookies window. After doing that, the problem is solved until…

    I click the “Dansk” (Danish) item. I can then no longer get “English back” no matter if I type-in domain address or click the “English” button. I always get redirected to misvblog.com/da/

    (Just tested/verified it again. But problem is only in FireFox, not Opera, IE, Safari, Chrome)

    Plugin Author Chouby

    (@chouby)

    Could you please post the content of the cookie you get in Firefox once you are stuck to misvblog.com/da/

    The cookie name is ‘pll_language’ and I need:
    * value
    * Domain (host)
    * path
    * expires

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Polylang chooses wrong language’ is closed to new replies.