mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-07 01:57:46 +00:00
44 lines
974 B
JavaScript
44 lines
974 B
JavaScript
Ext.define('Proxmox.window.LanguageEditWindow', {
|
|
extend: 'Ext.window.Window',
|
|
alias: 'widget.pmxLanguageEditWindow',
|
|
|
|
cookieName: 'PVELangCookie',
|
|
|
|
title: gettext('Language'),
|
|
modal: true,
|
|
bodyPadding: 10,
|
|
items: [
|
|
{
|
|
xtype: 'proxmoxLanguageSelector',
|
|
fieldLabel: gettext('Language'),
|
|
},
|
|
],
|
|
|
|
buttons: [
|
|
{
|
|
text: gettext('OK'),
|
|
handler: function() {
|
|
let me = this;
|
|
let win = this.up('window');
|
|
let value = win.down('proxmoxLanguageSelector').getValue();
|
|
let dt = Ext.Date.add(new Date(), Ext.Date.YEAR, 10);
|
|
Ext.util.Cookies.set(win.cookieName, value, dt);
|
|
win.mask(gettext('Please wait...'), 'x-mask-loading');
|
|
window.location.reload();
|
|
}
|
|
},
|
|
],
|
|
|
|
initComponent: function() {
|
|
let me = this;
|
|
|
|
if (!me.cookieName) {
|
|
throw "no cookie name given";
|
|
}
|
|
|
|
me.callParent();
|
|
me.down('proxmoxLanguageSelector')
|
|
.setValue(Ext.util.Cookies.get(me.cookieName) || '__default__');
|
|
},
|
|
});
|