]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #4551: ui: use gettext on hardcoded byte units
authorNoel Ullreich <n.ullreich@proxmox.com>
Mon, 3 Jul 2023 12:15:59 +0000 (14:15 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 5 Jul 2023 07:12:57 +0000 (09:12 +0200)
Since some languages translate byte units like 'GiB' or write them in their
own script, this patch wraps units in the `gettext` function.

While most occurrences of byte strings can be translated within the
`format_size` function in `proxmox-widget-toolkit/src/Utils.js`, this patch
catches those instances that are not translated.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
www/manager6/ceph/OSD.js
www/manager6/form/DiskStorageSelector.js
www/manager6/lxc/MPResize.js
www/manager6/qemu/HDResize.js

index 69d5061fcc80052534ba2ff06011940f8fdc4758..d2caafa4ae9c885e9cb5871c7e2f70eb60ff2616 100644 (file)
@@ -83,7 +83,7 @@ Ext.define('PVE.CephCreateOsd', {
                        {
                            xtype: 'numberfield',
                            name: 'db_dev_size',
-                           fieldLabel: gettext('DB size') + ' (GiB)',
+                           fieldLabel: `${gettext('DB size')} (${gettext('GiB')})`,
                            minValue: 1,
                            maxValue: 128*1024,
                            decimalPrecision: 2,
@@ -137,7 +137,7 @@ Ext.define('PVE.CephCreateOsd', {
                        {
                            xtype: 'numberfield',
                            name: 'wal_dev_size',
-                           fieldLabel: gettext('WAL size') + ' (GiB)',
+                           fieldLabel: `${gettext('WAL size')} (${gettext('GiB')})`,
                            minValue: 0.5,
                            maxValue: 128*1024,
                            decimalPrecision: 2,
index 860a3b3ca4410b2188479ff2ca89a9bd0d79a25f..0ef48f51204cec37895fce7584a50d40fa5ad607 100644 (file)
@@ -145,7 +145,7 @@ Ext.define('PVE.form.DiskStorageSelector', {
                xtype: 'numberfield',
                itemId: 'disksize',
                name: 'disksize',
-               fieldLabel: gettext('Disk size') + ' (GiB)',
+               fieldLabel: `${gettext('Disk size')} (${gettext('GiB')})`,
                hidden: me.hideSize,
                disabled: me.hideSize,
                minValue: 0.001,
index 881c037b067520fc2b9523d05f384bdc4e3e22be..d560b7886af3aa92f02086341d75c70065a8eaa6 100644 (file)
@@ -52,7 +52,7 @@ Ext.define('PVE.window.MPResize', {
            maxValue: 128*1024,
            decimalPrecision: 3,
            value: '0',
-           fieldLabel: gettext('Size Increment') + ' (GiB)',
+           fieldLabel: `${gettext('Size Increment')} (${gettext('GiB')})`,
            allowBlank: false,
        });
 
index 97bec73b1b8275bb982dd6f8ccf1111b9d02845f..e2a3ce49187457d05672e50b02709a1a7b0c4886 100644 (file)
@@ -53,7 +53,7 @@ Ext.define('PVE.window.HDResize', {
            maxValue: 128*1024,
            decimalPrecision: 3,
            value: '0',
-           fieldLabel: gettext('Size Increment') + ' (GiB)',
+           fieldLabel: `${gettext('Size Increment')} (${gettext('GiB')})`,
            allowBlank: false,
        });