Title: [Plugin: Cookie Compliance] Polylang compatible?
Last modified: August 20, 2016

---

# [Plugin: Cookie Compliance] Polylang compatible?

 *  [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/)
 * Hi,
 * qTranslate compatible. Great, but… what about the new multi-lingual kid on the
   block, Polylang?
 * [http://wordpress.org/extend/plugins/cookie-compliance/](http://wordpress.org/extend/plugins/cookie-compliance/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/page/2/?output_format=md)

 *  [tegotha](https://wordpress.org/support/users/tegotha/)
 * (@tegotha)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059460)
 * or wpml? WPML has a nice plugin string discovery and translation tool, but it
   does not work with your Cookie Compliance
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059560)
 * Hi RavanH and Tegotha,
 * we are working on making the plugin compatible with other language plugins as
   well.
    We will have a look into the Polylang and WPML plugins.
 * Anyone else any suggestions? Please let us know!
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059561)
 * Hi RavanH,
 * release 1.0.8 will be released today, it supports Polylang.
    If you experience
   any troubles, please let us know.
 *  Thread Starter [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059562)
 * That’s great news! I’ll be testing soon 🙂
 *  Thread Starter [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059563)
 * OK, first quick test with Polylang shows me the ability to change the texts for
   each configured language. Great!
 * However, it also breaks my home page 🙁
 * I use a static homepage with the Showcase template in Twenty Eleven. The Polylang
   options
    – “When using static front page, redirect the language page (example:
   [http://status301.net/en/](http://status301.net/en/)) to the front page in the
   right language” – “When the front page is visited, set the language according
   to the browser preference” – “Hide URL language information for default language”
   are checked.
 * But after accepting the cookie notice, the home page returns a 404…
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059565)
 * Hi RavanH,
 * an update was released tonight (version 1.0.10), this should fix the problem 
   you experienced.
    Can you check and let me know?
 * Thanks!
 *  Thread Starter [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059566)
 * It does not seem to change anything. I tried resaving permalink structure and
   both plugin settings but still the 404 on all language homepages occurs…
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059568)
 * ok, i will try to reproduce the error. I will let you know when we fixed it for
   sure 🙂
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059569)
 * Ok, i could reproduce the error pretty easy.
    Sorry i didnt see this before.
 * I added version 1.0.11 but didnt release it yet, could you try it?
 * It can be found here: [http://downloads.wordpress.org/plugin/cookie-compliance.1.0.11.zip](http://downloads.wordpress.org/plugin/cookie-compliance.1.0.11.zip)
 *  Thread Starter [Rolf Allard van Hagen](https://wordpress.org/support/users/ravanh/)
 * (@ravanh)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059570)
 * Yep, that seems to be working fine 🙂
 * Excellent work!
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059571)
 * Maybe I can help a bit…
 * But for this, I should understand the reason for you to instantiate a Polylang_Core
   object on admin side with:
 *     ```
       require_once(PLL_INC.'/core.php');
       $PolyLang = new Polylang_Core();
       require_once(PLL_INC.'/api.php');
       ```
   
 * I have seen that you use it only for the function `get_current_language` which
   is available only on frontend. Are you doing this for AJAX?
 * In that case, setting $_REQUEST[‘pll_load_front’] in your AJAX request should
   load the frontend side of Polylang, and then you can use the global variable `
   $polylang`. If you set $_REQUEST[‘lang’], Polylang will use it to set the language,
   otherwise it will use the preferred language (cookie or browser preference or
   default)
 * Edit: maybe my help is not needed anymore, if everything works
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059572)
 * Hi Chouby,
 * for the frontend using the `pll_current_language('slug')` is enough, only need
   to know the current language.
 * But in the backend we need to know the list of available languages. I use the
   function `get_languages_list()` for this.
 * Indeed the problem was caused by initiating the Polylang_Core object, which was
   also initiated when on the frontend.
 * It does work ok at the moment, but when you see anything that could be improved
   or simplified. All info is always welcome 🙂
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059573)
 * Hi RavanH,
 * thanks for the check! I will put it in the release now.
 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059574)
 * Well, in fact, I don’t understand the lines:
 *     ```
       $tmplang = get_object_vars($PolyLang->get_current_language());
       self::$language = $tmplang['slug'];
       ```
   
 * `get_current_language` has some meaning only on frontend but you call it when
   is_admin == true (that’s why I thought you are doing this for AJAX).
    Normally,
   it is not available on backend side (you can call it because you instantiated
   a “frontend” object of Polylang).
 * `get_languages_list()` is already available on both frontend and backend if you
   use the global object `$polylang`
 *  Plugin Author [zafrira](https://wordpress.org/support/users/zafrira/)
 * (@zafrira)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/#post-3059575)
 * ok, that makes sense…
 * i kinda just need to set a current or default language code in the backend when
   there is nothing chosen yet.
    Maybe better if i just take the first language 
   in the list when nothing is set… that should do… gonna try that, it would reduce
   the code indeed…

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/page/2/?output_format=md)

The topic ‘[Plugin: Cookie Compliance] Polylang compatible?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cookie-compliance_0064bf.svg)
 * [EU Cookie Law Compliance](https://wordpress.org/plugins/cookie-compliance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-compliance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-compliance/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-compliance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-compliance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-compliance/reviews/)

 * 18 replies
 * 4 participants
 * Last reply from: [zafrira](https://wordpress.org/support/users/zafrira/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-cookie-compliance-polylang-compatible/page/2/#post-3059579)
 * Status: not a support question