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?

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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