• I am using jigoshop, what comes with own po-mo files, affecting only the shop. Can I somehow implement them into polylang or vice versa to get nice multilingual site with little effort? Jigoshops language files are located in plugins -> jigo -> languages and activation works through wp-config, so it is not supposed to be multilingual.
    At the same time it would be worth to find out as jigoshop is increasingly popular.

    PS: only started with polylang, but seems to be nice, easy to use and logical.

    https://www.ads-software.com/extend/plugins/polylang/

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

    (@chouby)

    The problem is how Jigohsop loads its mo file (as soon as the plugin is loaded), giving no possibility to multilingual plugins to define the language before. So I guess the problem is not only with Polylang. The modification in Jigoshop is easy to do.

    Move the line 31 in jigoshop.php:

    load_plugin_textdomain('jigoshop', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');

    to line 200 just after:

    function jigoshop_init() {

    As the function jigoshop_init is hooked to the init action, which is executed after all plugins are loaded, it will allow Polylang to do the necessary actions to load the correct mo file.

    Thread Starter kokakoola

    (@kokakoola)

    Thank you for the suggestion! Jigoshop is far too complex for me to hack.

    Your modification seems to appear too late: will not hook the Jigoshop language file at all.

    There is some effort using in wp_config instead of define(‘WPLANG’, ‘your_LANGUAGE’);

    if (strpos($_SERVER['REQUEST_URI'],'/en/')>0) define ('WPLANG', 'en_EN');
    else define ('WPLANG', (($_GET['lang']) ? strtolower($_GET['lang']) .'_'. strtoupper($_GET['lang']) : 'your_LANGUAGE'));

    I DO get language switch in the shop area this way. But then I run into next trouble that I don’t understand the Jigoshops shop-page logic: it is neither Page nor Post actually but post type and if I create a page for translation (as it is supposed to be with Polylang) then it’s just an empty page. Jigo does not give any shortcodes or whatsoever to mark it as a Shop.

    And Cart does not change the shop language at the same time, what makes no sense to me (if the jigo mo is hooked then its hooked not that once it is and then it isn’t).

    It is not terribly urgent (as in many matters here in forum) so don’t bother. Would be good to knew thou. Is annoying to give up.

    Plugin Author Chouby

    (@chouby)

    I made a small test with the modification I proposed. It seems to work (at least English strings are loaded for a product in English, and French strings are loaded for a product in French). Moreover, I am not sure that defining WPLANG based on $_GET[‘lang’] will always work as, the way Polylang works, $_GET[‘lang’] is not always defined.

    For the cart (and most probably all pages automatically created by Jigoshop), the language is not automatically set by Jigoshop at the creation (since it is not aware of Polylang). You can check that the language column is empty for these pages. So you will have first to edit and resave all pages with (for example) the default language and then create a translation for each page (with the same shortcode). The only difference between the two pages will be the language.

    However, I did not test a lot of things so full compatibility may need extra work

    Thread Starter kokakoola

    (@kokakoola)

    If I move the lines as suggested the english version of jigoshop will be the only one what loads – all the rest changes language nicely except jigoshop. But good if it works for you. Intending to invest into WPML next: there are rumors it shall work with jigoshop. Will see.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Polylang] multiple po mo’ is closed to new replies.