]> git.proxmox.com Git - pve-manager.git/commitdiff
reduce translation overhead
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 4 Apr 2016 14:59:52 +0000 (16:59 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 4 Apr 2016 14:59:52 +0000 (16:59 +0200)
18 files changed:
www/manager6/Utils.js
www/manager6/VNCConsole.js
www/manager6/ceph/Pool.js
www/manager6/grid/BackupView.js
www/manager6/lxc/CmdMenu.js
www/manager6/lxc/Config.js
www/manager6/lxc/Options.js
www/manager6/lxc/Resources.js
www/manager6/lxc/SnapshotTree.js
www/manager6/node/Config.js
www/manager6/qemu/CmdMenu.js
www/manager6/qemu/Config.js
www/manager6/qemu/HardwareView.js
www/manager6/qemu/Options.js
www/manager6/qemu/SnapshotTree.js
www/manager6/storage/LvmThinEdit.js
www/manager6/window/Restore.js
www/manager6/window/SafeDestroy.js

index 633f4d7323887ed2b3a0cca5bfcdd81b3b81ed5f..07fd0f42594c300229098082ed8661ce044baa72 100644 (file)
@@ -549,6 +549,9 @@ Ext.define('PVE.Utils', { statics: {
        qmsuspend: [ 'VM', gettext('Suspend') ],
        qmresume: [ 'VM', gettext('Resume') ],
        qmconfig: [ 'VM', gettext('Configure') ],
+       vzsnapshot: [ 'CT', gettext('Snapshot') ],
+       vzrollback: [ 'CT', gettext('Rollback') ],
+       vzdelsnapshot: [ 'CT', gettext('Delete Snapshot') ],
        vzcreate: ['CT', gettext('Create') ],
        vzrestore: ['CT', gettext('Restore') ],
        vzdestroy: ['CT', gettext('Destroy') ],
index 3712fb9e7c53bf1f6533d4da80ede1c458b7b7ee..59807489750ffe927d368ef7de526159df5d45e3 100644 (file)
@@ -260,8 +260,8 @@ Ext.define('PVE.KVMConsole', {
            },
            {
                text: gettext('Shutdown'),
-               handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
+               handler: function() {               
+                   var msg = PVE.Utils.format_task_description('qmshutdown', me.vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -273,7 +273,7 @@ Ext.define('PVE.KVMConsole', {
            {
                text: gettext('Stop'),
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to stop VM {0}?"), me.vmid);
+                   var msg = PVE.Utils.format_task_description('qmstop', me.vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -290,7 +290,7 @@ Ext.define('PVE.KVMConsole', {
            {
                text: gettext('Reset'),
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to reset VM {0}?"), me.vmid);
+                   var msg = PVE.Utils.format_task_description('qmreset', me.vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -302,7 +302,7 @@ Ext.define('PVE.KVMConsole', {
            {
                text: gettext('Suspend'),
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to suspend VM {0}?"), me.vmid);
+                   var msg = PVE.Utils.format_task_description('qmsuspend', me.vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -387,7 +387,7 @@ Ext.define('PVE.LxcConsole', {
            {
                text: gettext('Shutdown'),
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), me.vmid);
+                   var msg = PVE.Utils.format_task_description('vzshutdown', me.vmid);             
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -399,7 +399,7 @@ Ext.define('PVE.LxcConsole', {
            {
                text: gettext('Stop'),
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to stop VM {0}?"), me.vmid);
+                   var msg = PVE.Utils.format_task_description('vzstop', me.vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
index ccff6a0acf9b23d9d7443ff688a737bd62439f14..b1f21403bacd3504c6f77210eabf561cba40d860 100644 (file)
@@ -167,7 +167,7 @@ Ext.define('PVE.node.CephPoolList', {
            confirmMsg: function(rec) {
                var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
                                            "'" + rec.data.pool_name + "'");
-               msg += " " + gettext('This will permanently erase all image data.');
+               msg += " " + gettext('This will permanently erase all data.');
 
                return msg;
            },
index 8ae09020aeb4a7b48c8c6f4f128db208c5458ec3..a4bf8579e66de774b5485548b2c105a6825c2418 100644 (file)
@@ -146,7 +146,7 @@ Ext.define('PVE.grid.BackupView', {
            confirmMsg: function(rec) {
                var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
                                            "'" + rec.data.volid + "'");
-               msg += " " + gettext('This will permanently erase all image data.');
+               msg += " " + gettext('This will permanently erase all data.');
 
                return msg;
            },
index c9280a7231bebce2308b5657fbe6b61209d1bc36..6640cbd27967322805634c66ae02cebbe0e38ce2 100644 (file)
@@ -53,7 +53,7 @@ Ext.define('PVE.lxc.CmdMenu', {
                text: gettext('Suspend'),
                icon: '/pve2/images/forward.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to suspend {0}?"), 'CT ' + vmid);
+                   var msg = PVE.Utils.format_task_description('vzsuspend', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -74,7 +74,7 @@ Ext.define('PVE.lxc.CmdMenu', {
                text: gettext('Shutdown'),
                icon: '/pve2/images/stop.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to shutdown {0}?"), 'CT ' + vmid);
+                   var msg = PVE.Utils.format_task_description('vzshutdown', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -88,7 +88,7 @@ Ext.define('PVE.lxc.CmdMenu', {
                text: gettext('Stop'),
                icon: '/pve2/images/gtk-stop.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to stop {0}?"), 'CT ' + vmid);
+                   var msg = PVE.Utils.format_task_description('vzstop', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -102,7 +102,7 @@ Ext.define('PVE.lxc.CmdMenu', {
 //             text: gettext('Convert to template'),
 //             icon: '/pve2/images/forward.png',
 //             handler: function() {
-//                 var msg = Ext.String.format(gettext("Do you really want to convert {0} into a template?"), 'CT ' + vmid);
+//                 var msg = PVE.Utils.format_task_description('vztemplate', vmid);
 //                 Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
 //                     if (btn !== 'yes') {
 //                         return;
index 8bf9078f86b5d3890db195d4a530be892304c7a7..a98bf67ea737ab9794ace3661800af33fb51ce95 100644 (file)
@@ -58,7 +58,7 @@ Ext.define('PVE.lxc.Config', {
        var stopBtn = Ext.create('PVE.button.Button', {
            text: gettext('Stop'),
            disabled: !caps.vms['VM.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to stop VM {0}?"), vmid),
+           confirmMsg: PVE.Utils.format_task_description('vzstop', vmid),
            handler: function() {
                vm_command("stop");
            }
@@ -67,7 +67,7 @@ Ext.define('PVE.lxc.Config', {
        var shutdownBtn = Ext.create('PVE.button.Button', {
            text: gettext('Shutdown'),
            disabled: !caps.vms['VM.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), vmid),
+           confirmMsg: PVE.Utils.format_task_description('vzshutdown', vmid),
            handler: function() {
                vm_command('shutdown');
            }
index a24aab4fd86b0f3413531282791d519df852c93e..523b5ddec1b08f833d59ce57b5319601a6b512a4 100644 (file)
@@ -119,12 +119,12 @@ Ext.define('PVE.lxc.Options', {
                } : undefined
            },
             protection: {
-                header: gettext('CT protection'),
+                header: gettext('Protection'),
                 defaultValue: false,
                 renderer: PVE.Utils.format_boolean,
                 editor: caps.vms['VM.Config.Options'] ? {
                     xtype: 'pveWindowEdit',
-                    subject: gettext('CT protection'),
+                    subject: gettext('Protection'),
                     items: {
                         xtype: 'pvecheckbox',
                         name: 'protection',
index 393b91de9051742fe9168badeed8a0930eccf258..5393f3934d970af13d7f37140d3c97d1a519ef63 100644 (file)
@@ -199,7 +199,7 @@ Ext.define('PVE.lxc.RessourceView', {
                var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
                                            "'" + me.renderKey(rec.data.key, {}, rec) + "'");
                if (rec.data.key.match(/^unused\d+$/)) {
-                   msg += " " + gettext('This will permanently erase all image data.');
+                   msg += " " + gettext('This will permanently erase all data.');
                }
 
                return msg;
index c0db6b7de4fa74e81ab36a51454f3b7c44d66739..113a76bd4ba6c227fc20fd09d0997db6d19327e7 100644 (file)
@@ -145,8 +145,8 @@ Ext.define('PVE.lxc.SnapshotTree', {
            selModel: sm,
            enableFn: valid_snapshot_rollback,
            confirmMsg: function(rec) {
-               var msg = Ext.String.format(gettext('Are you sure you want to rollback to snapshot {0}'),
-                                           "'" + rec.data.name + "'");
+               return PVE.Utils.format_task_description('vzrollback', me.vmid) +
+                   " '" +  rec.data.name + "'";
                return msg;
            },
            handler: function(btn, event) {
index 6d60bfcf80798eeff7f23abf0b08ee10a74abdfc..c770e8c68d8c624494f0df7435b99ba878a4c03b 100644 (file)
@@ -35,10 +35,10 @@ Ext.define('PVE.node.Config', {
            menu: new Ext.menu.Menu({
                items: [
                    {
-                       text: gettext('Start All VMs'),
+                       text: gettext('Start all VMs and Containers'),
                        icon: '/pve2/images/start.png',
                        handler: function() {
-                           var msg = Ext.String.format(gettext("Do you really want to start all Vms on  node {0}?"), nodename);
+                           var msg = gettext('Start all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename + "')";
                            Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                                if (btn !== 'yes') {
                                    return;
@@ -56,10 +56,10 @@ Ext.define('PVE.node.Config', {
                        }
                    },
                    {
-                       text: gettext('Stop All VMs'),
+                       text: gettext('Stop all VMs and Containers'),
                        icon: '/pve2/images/gtk-stop.png',
                        handler: function() {
-                           var msg = Ext.String.format(gettext("Do you really want to stop all Vms on  node {0}?"), nodename);
+                           var msg = gettext('Stop all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename + "')";
                            Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                                if (btn !== 'yes') {
                                    return;
@@ -77,7 +77,7 @@ Ext.define('PVE.node.Config', {
                        }
                    },
                    {
-                       text: gettext('Migrate All VMs'),
+                       text: gettext('Migrate all VMs and Containers'),
                        icon: '/pve2/images/forward.png',
                        handler: function() {
                            var win = Ext.create('PVE.window.MigrateAll', {
@@ -93,7 +93,7 @@ Ext.define('PVE.node.Config', {
        var restartBtn = Ext.create('PVE.button.Button', {
            text: gettext('Restart'),
            disabled: !caps.nodes['Sys.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to restart node {0}?"), nodename),
+           confirmMsg: gettext('Node') + " '" + nodename + "' - " + gettext('Restart'),
            handler: function() {
                node_command('reboot');
            }
@@ -102,7 +102,7 @@ Ext.define('PVE.node.Config', {
        var shutdownBtn = Ext.create('PVE.button.Button', {
            text: gettext('Shutdown'),
            disabled: !caps.nodes['Sys.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to shutdown node {0}?"), nodename),
+           confirmMsg: gettext('Node') + " '" + nodename + "' - " + gettext('Shutdown'),
            handler: function() {
                node_command('shutdown');
            }
index 5e889c693d60882231260b7b19808d589f26799c..7e9140b0c68bd66cb2deb6702cc870733b47652a 100644 (file)
@@ -53,7 +53,7 @@ Ext.define('PVE.qemu.CmdMenu', {
                text: gettext('Suspend'),
                icon: '/pve2/images/forward.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to suspend {0}?"), 'VM ' + vmid);
+                   var msg = PVE.Utils.format_task_description('qmsuspend', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -73,7 +73,7 @@ Ext.define('PVE.qemu.CmdMenu', {
                text: gettext('Shutdown'),
                icon: '/pve2/images/stop.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to shutdown {0}?"), 'VM ' + vmid);
+                   var msg = PVE.Utils.format_task_description('qmshutdown', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -87,7 +87,7 @@ Ext.define('PVE.qemu.CmdMenu', {
                text: gettext('Stop'),
                icon: '/pve2/images/gtk-stop.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to stop {0}?"), 'VM ' + vmid);
+                   var msg = PVE.Utils.format_task_description('qmstop', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
@@ -112,7 +112,7 @@ Ext.define('PVE.qemu.CmdMenu', {
                text: gettext('Convert to template'),
                icon: '/pve2/images/forward.png',
                handler: function() {
-                   var msg = Ext.String.format(gettext("Do you really want to convert {0} into a template?"), 'VM ' + vmid);
+                   var msg = PVE.Utils.format_task_description('qmtemplate', vmid);
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
index 603b4c260f612c0f7d7ac4669fc5361f6433b073..e39fca7c70d6e1f812625600fd7c37caca46476a 100644 (file)
@@ -58,7 +58,7 @@ Ext.define('PVE.qemu.Config', {
        var stopBtn = Ext.create('PVE.button.Button', {
            text: gettext('Stop'),
            disabled: !caps.vms['VM.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to stop VM {0}?"), vmid),
+           confirmMsg: PVE.Utils.format_task_description('qmstop', vmid),
            handler: function() {
                vm_command("stop", { timeout: 30 });
            }
@@ -80,7 +80,7 @@ Ext.define('PVE.qemu.Config', {
        var resetBtn = Ext.create('PVE.button.Button', {
            text: gettext('Reset'),
            disabled: !caps.vms['VM.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to reset VM {0}?"), vmid),
+           confirmMsg: PVE.Utils.format_task_description('qmreset', vmid),
            handler: function() {
                vm_command("reset");
            }
@@ -89,7 +89,7 @@ Ext.define('PVE.qemu.Config', {
        var shutdownBtn = Ext.create('PVE.button.Button', {
            text: gettext('Shutdown'),
            disabled: !caps.vms['VM.PowerMgmt'],
-           confirmMsg: Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), vmid),
+           confirmMsg: PVE.Utils.format_task_description('qmshutdown', vmid),
            handler: function() {
                vm_command('shutdown');
            }
index aef7e082152f66f39d751016a2537dfe1c176839..e0460d267bbcfdc4ea16234637408e6fab75bd74 100644 (file)
@@ -373,7 +373,7 @@ Ext.define('PVE.qemu.HardwareView', {
                var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
                                            "'" + me.renderKey(rec.data.key, {}, rec) + "'");
                if (rec.data.key.match(/^unused\d+$/)) {
-                   msg += " " + gettext('This will permanently erase all image data.');
+                   msg += " " + gettext('This will permanently erase all data.');
                }
 
                return msg;
index 6954cbe410f281a17e520e9fa4d41cb3a1ee1cdf..9585fe78ce7ecd9f13c8d91cbaddbe4e03d3d724 100644 (file)
@@ -263,12 +263,12 @@ Ext.define('PVE.qemu.Options', {
                } : undefined
            },
            protection: {
-               header: gettext('VM protection'),
+               header: gettext('Protection'),
                defaultValue: false,
                renderer: PVE.Utils.format_boolean,
                editor: caps.vms['VM.Config.Options'] ? {
                    xtype: 'pveWindowEdit',
-                   subject: gettext('VM protection'),
+                   subject: gettext('Protection'),
                    items: {
                        xtype: 'pvecheckbox',
                        name: 'protection',
index cd6dc4ee35f829c872e07b993de5dc4d4d1a14a0..e926d06055847c432f72a93b9d54b6585a75351e 100644 (file)
@@ -145,9 +145,8 @@ Ext.define('PVE.qemu.SnapshotTree', {
            selModel: sm,
            enableFn: valid_snapshot_rollback,
            confirmMsg: function(rec) {
-               var msg = Ext.String.format(gettext('Are you sure you want to rollback to snapshot {0}'),
-                                           "'" + rec.data.name + "'");
-               return msg;
+               return PVE.Utils.format_task_description('qmrollback', me.vmid) +
+                   " '" +  rec.data.name + "'";
            },
            handler: function(btn, event) {
                var rec = sm.getSelection()[0];
index a6f7cdb4c63191fb5876f677d48cf1385f8c10aa..dc42ef6164a48c2ffe9e0c7f4ab42b43c0cf283d 100644 (file)
@@ -153,7 +153,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
            me.column1.push({
                xtype: 'pveBaseVGSelector',
                name: 'vgname',
-               fieldLabel: gettext('Volume Group'),
+               fieldLabel: gettext('Volume group'),
                listeners: {
                    change: function(f, value) {
                        if (me.create) {
index b862157ed38bd45142b589821c29a6d978df0f3a..9cd63f663f0e038e090d431397dcd963215922bb 100644 (file)
@@ -88,20 +88,22 @@ Ext.define('PVE.window.Restore', {
                };
 
                var url;
+               var msg;
                if (me.vmtype === 'lxc') {
                    url = '/nodes/' + me.nodename + '/lxc';
                    params.ostemplate = me.volid;
                    params.restore = 1;
+                   msg = PVE.Utils.format_task_description('vzrestore', params.vmid);
                } else if (me.vmtype === 'qemu') {
                    url = '/nodes/' + me.nodename + '/qemu';
                    params.archive = me.volid;
+                   msg = PVE.Utils.format_task_description('qmrestore', params.vmid);
                } else {
                    throw 'unknown VM type';
                }
 
                if (me.vmid) {
-                   var msg = gettext('Are you sure you want to restore this VM?') + ' ' +
-                       gettext('This will permanently erase current VM data.');
+                   msg += '. ' + gettext('This will permanently erase current VM data.');
                    Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
                        if (btn !== 'yes') {
                            return;
index ec4a2f5e834fa6207c8445e06e491538fbf8eb40..4d93fc29b5e1bb468b03d2d40cd4390c7c537d1c 100644 (file)
@@ -6,7 +6,7 @@ Ext.define('PVE.window.SafeDestroy', {
     extend: 'Ext.window.Window',
     alias: 'widget.pveSafeDestroy',
 
-    title: gettext('Are you sure?'),
+    title: gettext('Confirm'),
     modal: true,
     buttonAlign: 'center',
     bodyPadding: 10,
@@ -91,7 +91,8 @@ Ext.define('PVE.window.SafeDestroy', {
            items: [
                {
                    xtype: 'component',
-                   bind: gettext('Are you sure you want to remove {item.type} {item.id}? This will permanently erase all data.')
+                   bind: gettext('Are you sure you want to remove {item.type} {item.id}?') + ' ' +
+                       gettext('This will permanently erase all data.')
                },
                {
                    reference: 'confirmField',