• Resolved Ricardo Amancio

    (@ricamancio)


    I can not translate the plugin.

    I created the pt_BR.po and pt_BR.mo files but does not work.

    I used the code in my file functions:

    function wpdocs_load_textdomain() {
      load_plugin_textdomain( 'livemesh-siteorigin-widgets', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    }
    add_action( 'plugins_loaded', 'wpdocs_load_textdomain' );

    What is wrong?

    Thank you

    https://ww.wp.xz.cn/plugins/livemesh-siteorigin-widgets/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author livemesh

    (@livemesh)

    Can you try using the language files in the <plugin-folder>/languages directory for translation? Pls let me know if that does not work and I will take a closer look. Thanks.

    Thread Starter Ricardo Amancio

    (@ricamancio)

    Yes other plugins are usually translated and without the need to add the code to the file functions.

    Ex: contact-form-7, revslider, siteorigin-panels, titan-framework …

    Thread Starter Ricardo Amancio

    (@ricamancio)

    I have also tried adding
    define ( 'WPLANG', 'en_US');
    the wp-config, but without work.

    Plugin Author livemesh

    (@livemesh)

    Can you change this line in your code –

    load_plugin_textdomain( 'livemesh-siteorigin-widgets', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );

    to

    load_plugin_textdomain( 'livemesh-so-widgets', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );

    and see if that works?

    You can also have a look at the function load_plugin_textdomain() in livemesh-so-widgets.php file.

    Thread Starter Ricardo Amancio

    (@ricamancio)

    The editing of the file functions is no longer necessary.

    It took only name the file correctly.

    I realized this after looking at the load_plugin_textdomain () function in LiveMesh-so-widgets.php file.

    livemesh-so-widgets-pt_BR.mo

    Thank you for your help.

    It worked.

    Plugin Author livemesh

    (@livemesh)

    Glad you were able to resolve this. Thanks for letting us know.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Translate’ is closed to new replies.