]> git.proxmox.com Git - pmg-gui.git/commitdiff
add Language selection in user menu for admin view
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 17 Apr 2020 11:23:38 +0000 (13:23 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Apr 2020 10:14:32 +0000 (12:14 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/MainView.js

index adbfb74e250769ca14a6ddd3ab0bfd1d4292fc6e..998ce4cdec8560a78a32498c932cfdfbe4ebb0a5 100644 (file)
@@ -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',