load_plugin_textdomain via basecontroller not working

enter image description here

I wan’t to translate my plugin with the load_plugin_textdomain functionality.

My __construct function is in my BaseController.php. So as I understood, I need to call the load_plugin_textdomain in the BaseController.php under the __construct function.

This is my code:

namespace IncBase;
class BaseController
{
    public $plugin_path;
    public $plugin_url;
    public $plugin;

    public function __construct() {
        $this->plugin_path = plugin_dir_path( dirname( __FILE__, 2 ) );
        $this->plugin_url = plugin_dir_url( dirname( __FILE__, 2 ) );
        $this->plugin = plugin_basename( dirname( __FILE__, 3 ) ) . '/mir-clubcashsystem-plugin.php';

        add_filter( 'admin_footer_text', '__return_false' );
        add_filter( 'update_footer', '__return_false', 11 );
        add_action( 'plugins_loaded', array(&$this,'i18n' ));
    }

    public function i18n() {
// this is my path: /Applications/MAMP/htdocs/mirplugins/wp-content/plugins/mir-clubcashsystem-plugin/lang/
        load_plugin_textdomain( 'mir-clubcashsystem-plugin', false, $this->plugin_path . 'lang/');
    }
}

But that’s not how it works. What do I missing here?
I don’t get any errors. It’s just not translate.

Here is a screenshot from my project:

Read more here:: load_plugin_textdomain via basecontroller not working

Leave a Reply

Your email address will not be published. Required fields are marked *