[pve-devel] [PATCH manager] ui: do not split translatable strings

Maximiliano Sandoval m.sandoval at proxmox.com
Fri Feb 28 11:23:42 CET 2025


Splitting the strings adds extra work to translators as they now have
less context to work with.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 www/manager6/ceph/OSD.js                    | 6 +++---
 www/manager6/dc/OptionView.js               | 2 +-
 www/manager6/panel/BackupAdvancedOptions.js | 2 +-
 www/manager6/qemu/PCIEdit.js                | 8 ++++----
 www/manager6/window/CephInstall.js          | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index d2caafa4a..67ad133f0 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -233,7 +233,7 @@ Ext.define('PVE.CephSetFlags', {
 
     onlineHelp: 'pve_ceph_osds',
     isCreate: true,
-    title: Ext.String.format(gettext('Manage {0}'), 'Global OSD Flags'),
+    title: gettext('Manage Global OSD Flags'),
     submitText: gettext('Apply'),
 
     items: [
@@ -833,11 +833,11 @@ Ext.define('PVE.node.CephOsdTree', {
 	    },
 	    '-',
 	    {
-		text: gettext('Create') + ': OSD',
+		text: gettext('Create: OSD'),
 		handler: 'create_osd',
 	    },
 	    {
-		text: Ext.String.format(gettext('Manage {0}'), 'Global Flags'),
+		text: gettext('Manage Global Flags'),
 		handler: 'set_flags',
 	    },
 	    '->',
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index bd54d7618..0496f6d5f 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -195,7 +195,7 @@ Ext.define('PVE.dc.OptionView', {
 		xtype: 'box',
 		height: 25,
 		html: `<span class='pmx-hint'>${gettext('Note:')}</span> `
-		    + Ext.String.format(gettext('{0} is deprecated, use {1}'), 'U2F', 'WebAuthn'),
+		    + gettext('U2F is deprecated, use WebAuthn'),
 	    },
 	    {
 		xtype: 'displayfield',
diff --git a/www/manager6/panel/BackupAdvancedOptions.js b/www/manager6/panel/BackupAdvancedOptions.js
index a7b0fc2b3..1050cbb1d 100644
--- a/www/manager6/panel/BackupAdvancedOptions.js
+++ b/www/manager6/panel/BackupAdvancedOptions.js
@@ -158,7 +158,7 @@ Ext.define('PVE.panel.BackupAdvancedOptions', {
 		xtype: 'proxmoxintegerfield',
 		name: 'zstd',
 		reference: 'zstdThreadCount',
-		fieldLabel: Ext.String.format(gettext('{0} Threads'), 'Zstd'),
+		fieldLabel: gettext('Zstd Threads'),
 		fieldStyle: 'text-align: right',
 		emptyText: gettext('Fallback'),
 		minValue: 0,
diff --git a/www/manager6/qemu/PCIEdit.js b/www/manager6/qemu/PCIEdit.js
index 8f633cb6e..6ed9918c5 100644
--- a/www/manager6/qemu/PCIEdit.js
+++ b/www/manager6/qemu/PCIEdit.js
@@ -288,7 +288,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 	    {
 		xtype: 'textfield',
 		name: 'vendor-id',
-		fieldLabel: Ext.String.format(gettext('{0} ID'), gettext('Vendor')),
+		fieldLabel: gettext('Vendor ID'),
 		emptyText: gettext('From Device'),
 		vtype: 'PciId',
 		allowBlank: true,
@@ -297,7 +297,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 	    {
 		xtype: 'textfield',
 		name: 'device-id',
-		fieldLabel: Ext.String.format(gettext('{0} ID'), gettext('Device')),
+		fieldLabel: gettext('Device ID'),
 		emptyText: gettext('From Device'),
 		vtype: 'PciId',
 		allowBlank: true,
@@ -315,7 +315,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 	    {
 		xtype: 'textfield',
 		name: 'sub-vendor-id',
-		fieldLabel: Ext.String.format(gettext('{0} ID'), gettext('Sub-Vendor')),
+		fieldLabel: gettext('Sub-Vendor ID'),
 		emptyText: gettext('From Device'),
 		vtype: 'PciId',
 		allowBlank: true,
@@ -324,7 +324,7 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 	    {
 		xtype: 'textfield',
 		name: 'sub-device-id',
-		fieldLabel: Ext.String.format(gettext('{0} ID'), gettext('Sub-Device')),
+		fieldLabel: gettext('Sub-Device ID'),
 		emptyText: gettext('From Device'),
 		vtype: 'PciId',
 		allowBlank: true,
diff --git a/www/manager6/window/CephInstall.js b/www/manager6/window/CephInstall.js
index 326051291..759536c39 100644
--- a/www/manager6/window/CephInstall.js
+++ b/www/manager6/window/CephInstall.js
@@ -35,11 +35,11 @@ Ext.define('PVE.ceph.Install', {
 	    windowText: function(get) {
 		if (get('isInstalled')) {
 		    return `<p class="install-mask">
-		    ${Ext.String.format(gettext('{0} is not initialized.'), 'Ceph')}
+		    ${gettext('Ceph is not initialized.')}
 		    ${gettext('You need to create an initial config once.')}</p>`;
 		} else {
 		    return '<p class="install-mask">' +
-		    Ext.String.format(gettext('{0} is not installed on this node.'), 'Ceph') + '<br>' +
+		    gettext('Ceph is not installed on this node.') + '<br>' +
 		    gettext('Would you like to install it now?') + '</p>';
 		}
 	    },
-- 
2.39.5





More information about the pve-devel mailing list