public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] notify ui: fix `gettext` calls
@ 2023-08-28 12:58 Lukas Wagner
  0 siblings, 0 replies; only message in thread
From: Lukas Wagner @ 2023-08-28 12:58 UTC (permalink / raw)
  To: pve-devel

gettext is rather dumb and does not like multi-line strings or string
interpolation.

Also removed some unneeded gettext calls (mail-to-root should not be
translated.)

Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 www/manager6/dc/NotificationEvents.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/www/manager6/dc/NotificationEvents.js b/www/manager6/dc/NotificationEvents.js
index f2ee12e0..18816290 100644
--- a/www/manager6/dc/NotificationEvents.js
+++ b/www/manager6/dc/NotificationEvents.js
@@ -29,8 +29,7 @@ Ext.define('PVE.dc.NotificationEventDisabledWarning', {
     extend: 'Ext.form.field.Display',
     userCls: 'pmx-hint',
     hidden: true,
-    value: gettext('Disabling notifications is not ' +
-        'recommended for production systems!'),
+    value: gettext('Disabling notifications is not recommended for production systems!'),
 });
 
 Ext.define('PVE.dc.NotificationEventsTargetSelector', {
@@ -41,7 +40,7 @@ Ext.define('PVE.dc.NotificationEventsTargetSelector', {
     editable: true,
     autoSelect: false,
     deleteEmpty: false,
-    emptyText: `${Proxmox.Utils.defaultText} (${gettext("mail-to-root")})`,
+    emptyText: `${Proxmox.Utils.defaultText} (mail-to-root)`,
 });
 
 Ext.define('PVE.dc.NotificationEvents', {
@@ -127,7 +126,7 @@ Ext.define('PVE.dc.NotificationEvents', {
 	// Needed since the actual value is always stored in the 'notify' property
 	let render_value = (store, target_key, mode_key, default_val) => {
 	    let value = store.getById('notify')?.get('value') ?? {};
-	    let target = value[target_key] ?? gettext('mail-to-root');
+	    let target = value[target_key] ?? 'mail-to-root';
 	    let template;
 
 	    switch (value[mode_key]) {
-- 
2.39.2





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-28 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 12:58 [pve-devel] [PATCH manager] notify ui: fix `gettext` calls Lukas Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal