Can not change text when using Localization Sencha ExtJs

207 Views Asked by At

I has question about Localization, I create key in Labels.js file, code :

Ext.define('Portal.Labels', {
    singleton: true,
    title: ''
});

And in event click of button, I using:

    var main = Ext.getCmp('main'); // Get main (container) and destroy it.
    main.destroy();
    // Sure main is destroyed.
    // Get url of local.
    var url = Ext.util.Format.format('ext/packages/ext-locale/overrides/vn/ext-locale-vn.js');
    // Sure url is loaded.
    // Load script local file.
    Ext.Loader.loadScript({
        url: url,
        scope: this
    }
    );
    // Create main and show it.
    main = Ext.create('main');
    main.show();

In ext-locale-vn.js, I add :

Ext.define("Portal.locale.vn.Labels", {
    override: "Portal.Labels",
        title: "DASHBOARD"
});

In main container, I create lable:

        xtype: 'label',
        text:Portal.Labels.title

But when I click button, text of label still not change to "DASHBOARD", I don't know where I was wrong, please help me.

0

There are 0 best solutions below