I'm working on a custom Wordpress plugin but I cannot get it multi-lang ready.
It does load the .mo file of the main language properly, but when switching languages (using WPML), it always shows the translation of the main language (in this case German). So when I am on English, it still shows the German translations.
Here's my code:
in the header:
/*
Plugin Name: MM Jobs
Plugin URI: http://example.com/
Description: Custom Jobs Plugin to create new Jobs
Version: 1.3.84
Author: Jekey
Author URI: http://example.com/
Text Domain: mm-jobs
Domain Path: /languages
*/
then:
function mm_jobs_plugins_loaded() {
load_plugin_textdomain( 'mm-jobs', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'mm_jobs_plugins_loaded', 0 );
.mo files are correct, as it already loads the German translation. Named: mm-jobs-en_US.mo or mm-jobs-de_DE.mo under /plugins/mm-jobs/languages/
You have any idea what's causing the problem?