[pve-devel] [RFC manager 02/28] use LanguageSelector from widget toolkit
Thomas Lamprecht
t.lamprecht at proxmox.com
Mon Dec 11 16:25:51 CET 2017
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
www/manager6/Makefile | 1 -
www/manager6/Utils.js | 42 -----------------------------------
www/manager6/form/LanguageSelector.js | 5 -----
www/manager6/window/LoginWindow.js | 2 +-
4 files changed, 1 insertion(+), 49 deletions(-)
delete mode 100644 www/manager6/form/LanguageSelector.js
diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 6f5b72ca..dc2069f8 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -59,7 +59,6 @@ JSSRC= \
form/IPProtocolSelector.js \
form/CPUModelSelector.js \
form/VNCKeyboardSelector.js \
- form/LanguageSelector.js \
form/DisplaySelector.js \
form/CacheTypeSelector.js \
form/SnapshotSelector.js \
diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 3efe4e71..94bae5b2 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -315,48 +315,6 @@ Ext.define('PVE.Utils', { utilities: {
}
},
- language_map: {
- zh_CN: 'Chinese',
- ca: 'Catalan',
- da: 'Danish',
- en: 'English',
- eu: 'Euskera (Basque)',
- fr: 'French',
- de: 'German',
- it: 'Italian',
- ja: 'Japanese',
- nb: 'Norwegian (Bokmal)',
- nn: 'Norwegian (Nynorsk)',
- fa: 'Persian (Farsi)',
- pl: 'Polish',
- pt_BR: 'Portuguese (Brazil)',
- ru: 'Russian',
- sl: 'Slovenian',
- es: 'Spanish',
- sv: 'Swedish',
- tr: 'Turkish'
- },
-
- render_language: function (value) {
- if (!value) {
- return PVE.Utils.defaultText + ' (English)';
- }
- var text = PVE.Utils.language_map[value];
- if (text) {
- return text + ' (' + value + ')';
- }
- return value;
- },
-
- language_array: function() {
- var data = [['__default__', PVE.Utils.render_language('')]];
- Ext.Object.each(PVE.Utils.language_map, function(key, value) {
- data.push([key, PVE.Utils.render_language(value)]);
- });
-
- return data;
- },
-
render_kvm_vga_driver: function (value) {
if (!value) {
return PVE.Utils.defaultText;
diff --git a/www/manager6/form/LanguageSelector.js b/www/manager6/form/LanguageSelector.js
deleted file mode 100644
index 5e30ee67..00000000
--- a/www/manager6/form/LanguageSelector.js
+++ /dev/null
@@ -1,5 +0,0 @@
-Ext.define('PVE.form.LanguageSelector', {
- extend: 'PVE.form.KVComboBox',
- alias: ['widget.pveLanguageSelector'],
- comboItems: PVE.Utils.language_array()
-});
diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index 29fd187f..4db3c8e4 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -171,7 +171,7 @@ Ext.define('PVE.window.LoginWindow', {
name: 'realm'
},
{
- xtype: 'pveLanguageSelector',
+ xtype: 'proxmoxLanguageSelector',
fieldLabel: gettext('Language'),
value: Ext.util.Cookies.get('PVELangCookie') || 'en',
name: 'lang',
--
2.11.0
More information about the pve-devel
mailing list