I translated my plugin and put all the files (my-plugin-de_DE_formal.po
, my-plugin-de_DE_formal.mo
, my-plugin.pot
) in the wp-content/plugins/my-plugin/languages
folder.
My plugins header says:
…
Text Domain: my-plugin
Domain Path: /languages
…
Inside my code I loaded the textdomain like that:
function mp__load_textdomain() {
load_plugin_textdomain( 'my-plugin', false, 'my-plugin/languages' );
}
add_action( 'init', 'mp__load_textdomain' );
I also check the return value of load_plugin_textdomain
and it says true
.
But all my translations will not show up. But if I move the .po
and .mo
files to the global folder wp-content/languages/plugins
it works just fine.
I want to keep the translation file inside my plugin folder but I‘m stuck and can‘t figure out why it doesn‘t work that way.