PHP Code:
Ext.define('Ext.app.MainViewport', {
extend: 'Ext.container.Viewport',
initComponent: function () {
Ext.app.locale.LocaleManager.setConfig({
language : 'es',
ns : 'locale',
path : '../locale'
});
Ext.app.locale.LocaleManager.loadLocale(this.applyLanguage);
var northRegion = {
xtype: 'container',
region: 'north',
width: 400,
layout: {
type: 'hbox',
padding: '1',
pack: 'end',
align: 'top'
},
items: [{
xtype: 'buttongroup',
columns: 3,
items: [{
xtype: 'button',
text: 'Galdaka', //NEED LOCALE TEXT HERE!!
align: 'middle',
autoWidth: true,
iconCls: 'user',
menu: [{
text: 'Login...', //NEED LOCALE TEXT HERE!!
iconCls: 'login',
handler: Ext.bind(this.msg, this)
}, {
text: 'Logout', //NEED LOCALE TEXT HERE!!
iconCls: 'logout',
handler: Ext.bind(this.msg, this)
}]
}]
}]
};
var centerRegion = {
xtype: 'container',
region: 'center',
layout: 'border',
defaults: {
split: true
},
border: false,
items: [{
id: 'app-container',
title: 'Aplicaciones', //NEED LOCALE TEXT HERE!!
region: 'west',
hidden: true,
animCollapse: true,
collapsible: true,
width: 200,
stateful: false,
minWidth: 150,
maxWidth: 400,
layout: 'accordion',
layoutConfig: {
animate: true
}
}, {
id: 'app-center-container',
xtype: 'tabpanel',
region: 'center',
resizeTabs: true,
enableTabScroll: true,
items: [{
xtype: 'portalpanel',
title: 'Inicio', //NEED LOCALE TEXT HERE!!
iconCls: 'home',
items: [{
id: 'col-1',
items: [{
id: 'portlet-1',
height: 200,
title: 'Donaciones ExtJS', //NEED LOCALE TEXT HERE!!
html: '<div>sfdfdfd</div>'
}]
},{
id: 'col-2',
items: [{
id: 'portlet-3',
height: 140,
title: 'Currículum', //NEED LOCALE TEXT HERE!!
html: '<div>sfdfdfd</div>'
}]
}]
}],
listeners: {
tabchange: Ext.bind(this.expandAppTree, this)
}
}]
};
Ext.apply(this, {
id: 'appMainViewport',
layout: {
type: 'border',
},
items: [northRegion, centerRegion]
}
);
},
applyLanguage: function(manager){
alert(manager.get('buttons.action'))
}
....
I don´t understand. Where is the secuence of call for make translation in this case?