load_plugin_textdomain not working load_plugin_textdomain not working wordpress wordpress

load_plugin_textdomain not working


I just was with a similar isue, did you try to rename your files from de_DE.po and de_DE.mo to name-of-plugin-de_DE.mo and name-of-plugin-de_DE.po (changing name-of-plugin with yours, of course)?

dplus-de_DE.mo and dplus-de_DE.po It must work ;)


load_plugin_textdomain takes three parameters.In your case it would be something like this (assuming the .po and .mo files are located in a subdir called 'languages')

load_plugin_textdomain( 'dplus', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );


I checked the source of DonatePlus Plugin and I found that the Plugin is doing localization wrongly.

The load_plugin_textdomain() call is made inside the DonatePlus classes constructor. But it should be present inside the 'init' hook. Trying adding the following code (which is at the of the file) inside the init function.

if( class_exists('DonatePlus') )    $donateplus = new DonatePlus();