ui: adapt to fix of Korean language code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-01-18 14:11:28 +01:00
parent 8c260fdbc5
commit e1a0e868c7
3 changed files with 14 additions and 2 deletions

2
debian/control vendored
View File

@ -87,7 +87,7 @@ Depends: apt (>= 1.5~),
pve-docs (>= 8.0~~),
pve-firewall,
pve-ha-manager,
pve-i18n (>= 1.0-3),
pve-i18n (>= 3.2.0~),
pve-xtermjs (>= 4.7.0-1),
qemu-server (>= 8.0.4),
rsync,

View File

@ -1925,6 +1925,18 @@ Ext.define('PVE.Utils', {
isStandaloneNode: function() {
return PVE.data.ResourceStore.getNodes().length < 2;
},
// main use case of this helper is the login window
getUiLanguage: function() {
let languageCookie = Ext.util.Cookies.get('PVELangCookie');
if (languageCookie === 'kr') {
// fix-up 'kr' being used for Korean by mistake FIXME: remove with PVE 9
let dt = Ext.Date.add(new Date(), Ext.Date.YEAR, 10);
languageCookie = 'ko';
Ext.util.Cookies.set('PVELangCookie', languageCookie, dt);
}
return languageCookie || Proxmox.defaultLang || 'en';
},
},
singleton: true,

View File

@ -367,7 +367,7 @@ Ext.define('PVE.window.LoginWindow', {
{
xtype: 'proxmoxLanguageSelector',
fieldLabel: gettext('Language'),
value: Ext.util.Cookies.get('PVELangCookie') || Proxmox.defaultLang || 'en',
value: PVE.Utils.getUiLanguage(),
name: 'lang',
reference: 'langField',
submitValue: false,