The language is changed only automatically to English

New home Forums Pro Add-on The language is changed only automatically to English

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30328

    Hi.

    This is the second time the same thing happens to me.

    Before the wp-google-maps plugin appeared in Spanish, but now it appears in English. The language has been changed only automatically.

    On the other hand, the addons Visitor Generated Markers, I never appeared in Spanish. But the .mo file is translated.

    I have tried copying the two language files in wp-content / languages, but it does not work.

    Please, I need the whole plugin and its addons to look like in Spanish.

    Thank you very much.

    #30407
    SupportTeam
    Moderator

    Hi there

    Thank you for getting in touch with us.

    Our plugin has been translated into Spanish on WordPress.org – as a result of this, the basic version’s language files overwrite the (complete) language files that our plugin ships with.

    Please login to your WordPress site, navigate to the plugin editor and go to wp-google-maps-pro/wp-google-maps-pro.php. Please add in the following code at the bottom of the file:

    add_action( ‘init’, ‘wpgmza_translation_fix’ );

    function wpgmza_translation_fix(){
    $domain = “wp-google-maps”;
    $plugin_rel_path = ‘wp-google-maps/languages/’;
    $locale = apply_filters( ‘plugin_locale’, is_admin() ? get_user_locale() : get_locale(), $domain );
    $mofile = ‘wp-google-maps’ . ‘-‘ . $locale . ‘.mo’;

    if ( false !== $plugin_rel_path ) {
    $path = WP_PLUGIN_DIR . ‘/’ . trim( $plugin_rel_path, ‘/’ );
    } else {
    $path = WP_PLUGIN_DIR;
    }

    load_textdomain( $domain, $path . ‘/’ . $mofile );
    }

    The above code will ensure that the remaining strings in our plugins translate as expected.

    I hope this helps?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.