Support » Plugin: Polylang » Automatic page redirect to language based on location

  • The provided link is the default language(English) of the page and has a secondary language which is in zh_chinese. When I try to access the page by using the English URL on a China location and a browser language of Chinese, I don’t get any redirects to the Chinese translated version. But on the front/home page redirect is working fine.

    This is the link for the Chinese translated page:
    http://flux.qfx9befdwh-dv13x5qyq4gq.p.runcloud.link/sample-page-cn/

    The URL modifications are set to
    1. The language is set from content
    2. Hide URL information for default language
    3. Remove /language/ in pretty permalinks
    4. The front page url contains the language code instead of the page name or page id

    and the Detect browser language setting is activated.

    How can I enable the redirect on pages aside from the home page?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    The Polylang detection of the browser preferred language intentionnally works only on the home page only. This is meant for people having only the information about the domin and not a complete url. For internal urls, we suppose that people got a link in the correct language. For example, a search engine provides you a link in the language of the search.

    It’s possible to code yourself the feature (or ask a developer to make it if you don’t know how to), by checking the super global $_SERVER['HTTP_ACCEPT_LANGUAGE'] as Polylang does, but be aware that if you make in PHP, it will be incompatible with cache plugins (one of the main reason why we limited the feature to the homepage).

Viewing 1 replies (of 1 total)
  • The topic ‘Automatic page redirect to language based on location’ is closed to new replies.