Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In my plugin's init function

    load_textdomain( 'myplugin', ABS_PATH_TO_MO_FILE ); // OK

    load_plugin_textdomain( 'myplugin', false,  ABS_PATH_TO_LANGS_DIR); // No effect

    echo( __('Test', 'myplugin') );

In the code above, the load_textdomain works, but not load_plugin_textdomain, any idea?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Looking at the source load_plugin_textdomain takes three arguments:

load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false )

It seems you are passing the absolute path to your language domain, as a relative path. Try:

load_plugin_textdomain( 'myplugin', ABS_PATH_TO_LANGS_DIR);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.