WordPress.org

Ready to get started?Download WordPress

Forums

SimpleMap Store Locator
[resolved] Default language VS Current language (3 posts)

  1. Elementis
    Member
    Posted 1 year ago #

    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/

  2. Elementis
    Member
    Posted 1 year ago #

    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' ) );

  3. Brian KD
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags