WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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.