WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: SimpleMap Store Locator] Default language VS Current language

[Resolved] [Plugin: SimpleMap Store Locator] Default language VS Current language

  • I’m having a little problem in the locations section. Since I added a french translation (.mo/.po files), the text in the English website appears in French… The default language of my site is French.

    At first the problem was all over the page, like if the original strings were not working. After little changes, the problem is only in the loaded section below the map. Anyone had this problem?

    http://wordpress.org/extend/plugins/simplemap/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Found a solution that work with WPML. In plugins/simplemap/classes/simplemap.php, I changed

    wp_enqueue_script( 'simplemap-master-js', site_url() . '?simplemap-master-js=1&smpid=' . $post->ID, array( 'jquery' ) );

    by

    wp_enqueue_script( 'simplemap-master-js', site_url() . '/'.ICL_LANGUAGE_CODE. '/?simplemap-master-js', array( 'jquery' ) );

    Brian KD

    @brian-kd

    Thanks for posting. I’m guessing this will save me a bundle of time 🙂

    I wrapped it in an if statement looking for the WPML constant to be defined. If it’s undefined (plugin is turned off, damaged, or deleted) then the original code would kick in:


    if (defined(ICL_LANGUAGE_CODE)) {
    wp_enqueue_script( 'simplemap-master-js', site_url() . '/'.ICL_LANGUAGE_CODE. '/?simplemap-master-js', array( 'jquery' ) );
    } else {
    wp_enqueue_script( 'simplemap-master-js', site_url() . '?simplemap-master-js=1&smpid=' . $post->ID, array( 'jquery' ) );
    }

    Cheers,
    Brian Peterson
    kismetwebdesign.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: SimpleMap Store Locator] Default language VS Current language’ is closed to new replies.