Support » Plugin: Weather Layer » Multilanguage

  • Hello,

    my question is, how can I use this in a multilanguage site. Could you possibly transfer the language setting to the shortcode like this:

    [weatherlayer country=”Spain” city=”S’Illot” lang=”es”] ?

    So one could easily integrate this with WPML for example.

    Thank you!

    https://wordpress.org/plugins/weather-layer/

Viewing 2 replies - 1 through 2 (of 2 total)
  • This plugin is quite neat. It is missing a multi-language option though.

    I’m using polylang and was able to make a quick fix.

    Open up wp-content/plugins/weather-layer/weather_layer.php and comment this line:
    $langue = weather_layer_getLanguage();

    Replace with:
    if ( pll_current_language() == ‘en’ ) {
    $langue =”en”;
    }
    else {
    $langue = “fr”;
    }

    I’m using Qtranslate-x, and this works for me,
    comment out $langue = weather_layer_getLanguage();
    and replace with:
    if ($GLOBALS[‘q_config’][‘language’]==’en’)
    $langue =”en”;
    else
    $langue = “fr”;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multilanguage’ is closed to new replies.