[pve-devel] [PATCH pmg-gui 2/2] add Language selection in user menu for admin view

Dominik Csapak d.csapak at proxmox.com
Fri Apr 17 13:23:38 CEST 2020


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/MainView.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/js/MainView.js b/js/MainView.js
index adbfb74..998ce4c 100644
--- a/js/MainView.js
+++ b/js/MainView.js
@@ -91,10 +91,19 @@ Ext.define('PMG.MainView', {
 	    this.redirectTo(item.get('path'));
 	},
 
+	changeLanguage: function() {
+	    Ext.create('Proxmox.window.LanguageEditWindow', {
+		cookieName: 'PMGLangCookie'
+	    }).show();
+	},
+
 	control: {
 	    '[reference=logoutButton]': {
 		click: 'logout'
-	    }
+	    },
+	    '[reference=languageButton]': {
+		click: 'changeLanguage',
+	    },
 	},
 
 	init: function(view) {
@@ -191,6 +200,12 @@ Ext.define('PMG.MainView', {
 		    margin: '0 5 0 0',
 		    iconCls: 'fa fa-user',
 		    menu: [
+			{
+			    iconCls: 'fa fa-language',
+			    text: gettext('Language'),
+			    reference: 'languageButton',
+			},
+			'-',
 			{
 			    reference: 'logoutButton',
 			    iconCls: 'fa fa-sign-out',
-- 
2.20.1





More information about the pve-devel mailing list