[pve-devel] [PATCH manager v2 2/2] Split the Enable + name construct in two separate gettext strings

Emmanuel Kasper e.kasper at proxmox.com
Wed Jan 18 17:03:33 CET 2017


This reduce the number of strings to translate.
---
 www/manager6/grid/FirewallOptions.js | 10 +++++-----
 www/manager6/lxc/Options.js          |  6 +++---
 www/manager6/lxc/ResourceEdit.js     |  2 +-
 www/manager6/qemu/ProcessorEdit.js   |  2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/www/manager6/grid/FirewallOptions.js b/www/manager6/grid/FirewallOptions.js
index 859dc1f..184c864 100644
--- a/www/manager6/grid/FirewallOptions.js
+++ b/www/manager6/grid/FirewallOptions.js
@@ -103,10 +103,10 @@ Ext.define('PVE.FirewallOptions', {
 
 
 	if (me.fwtype === 'node') {
-	    add_boolean_row('enable', gettext('Enable Firewall'), 1);
+	    add_boolean_row('enable', Ext.String.format(gettext('Enable {0}'), gettext('Firewall')), 1);
 	    add_boolean_row('nosmurfs', gettext('SMURFS filter'), 1);
 	    add_boolean_row('tcpflags', gettext('TCP flags filter'), 0);
-	    add_boolean_row('ndp', gettext('Enable NDP'), 1);
+	    add_boolean_row('ndp', Ext.String.format(gettext('Enable {0}'), 'NDP'), 1);
 	    add_integer_row('nf_conntrack_max', 'nf_conntrack_max', 120, 32768);
 	    add_integer_row('nf_conntrack_tcp_timeout_established', 
 			    'nf_conntrack_tcp_timeout_established', 250, 7875);
@@ -116,15 +116,15 @@ Ext.define('PVE.FirewallOptions', {
 	    add_log_row('smurf_log_level');
 	} else if (me.fwtype === 'vm') {
 	    add_boolean_row('enable', gettext('Enable Firewall'), 0);
-	    add_boolean_row('dhcp', gettext('Enable DHCP'), 0);
-	    add_boolean_row('ndp', gettext('Enable NDP'), 1);
+	    add_boolean_row('dhcp', Ext.String.format(gettext('Enable {0}'), 'DHCP'), 0);
+	    add_boolean_row('ndp', Ext.String.format(gettext('Enable {0}'), 'NDP'), 1);
 	    add_boolean_row('radv', gettext('Allow Router Advertisement'), 0);
 	    add_boolean_row('macfilter', gettext('MAC filter'), 1);
 	    add_boolean_row('ipfilter', gettext('IP filter'), 0);
 	    add_log_row('log_level_in');
 	    add_log_row('log_level_out');
 	} else if (me.fwtype === 'dc') {
-	    add_boolean_row('enable', gettext('Enable Firewall'), 0);
+	    add_boolean_row('enable', Ext.String.format(gettext('Enable {0}'), gettext('Firewall')), 0);
 	} 
  
 	if (me.fwtype === 'dc' || me.fwtype === 'vm') {
diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index 1c39b4b..1326ee0 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -57,12 +57,12 @@ Ext.define('PVE.lxc.Options', {
 		defaultValue: PVE.Utils.unknownText
 	    },
 	    console: {
-		header: gettext('Enable /dev/console'),
+		header: Ext.String.format(gettext('Enable {0}'), '/dev/console'),
 		defaultValue: 1,
 		renderer: PVE.Utils.format_boolean,
 		editor: caps.vms['VM.Config.Options'] ? {
 		    xtype: 'pveWindowEdit',
-		    subject: gettext('Enable /dev/console'),
+		    subject: Ext.String.format(gettext('Enable {0}'), '/dev/console'),
 		    items: {
 			xtype: 'pvecheckbox',
 			name: 'console',
@@ -70,7 +70,7 @@ Ext.define('PVE.lxc.Options', {
 			defaultValue: 1,
 			deleteDefaultValue: true,
 			checked: true,
-			fieldLabel: gettext('Enable /dev/console')
+			fieldLabel: Ext.String.format(gettext('Enable {0}'), '/dev/console')
 		    }
 		} : undefined
 	    },
diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index 156c99f..cf664ed 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -487,7 +487,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
 	me.quota = Ext.createWidget('pvecheckbox', {
 	    name: 'quota',
 	    defaultValue: 0,
-	    fieldLabel: gettext('Enable quota')
+	    fieldLabel: Ext.String.format(gettext('Enable {0}'), gettext('quota'))
 	});
 
 	me.column2 = [
diff --git a/www/manager6/qemu/ProcessorEdit.js b/www/manager6/qemu/ProcessorEdit.js
index 01da703..ef9600a 100644
--- a/www/manager6/qemu/ProcessorEdit.js
+++ b/www/manager6/qemu/ProcessorEdit.js
@@ -75,7 +75,7 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
 	    },
 	    {
 		xtype: 'pvecheckbox',
-		fieldLabel: gettext('Enable NUMA'),
+		fieldLabel: Ext.String.format(gettext('Enable {0}'), 'NUMA'),
 		name: 'numa',
 		uncheckedValue: 0
 	    }
-- 
2.1.4





More information about the pve-devel mailing list