[pve-devel] [PATCH v2 proxmox-widget-toolkit 7/8] panel: notification: fix `gettext` calls

Lukas Wagner l.wagner at proxmox.com
Thu Aug 31 16:30:21 CEST 2023


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

Reported-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/panel/NotificationConfigView.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/panel/NotificationConfigView.js b/src/panel/NotificationConfigView.js
index 6586524..770ae4a 100644
--- a/src/panel/NotificationConfigView.js
+++ b/src/panel/NotificationConfigView.js
@@ -88,7 +88,10 @@ Ext.define('Proxmox.panel.NotificationEndpointView', {
 
 	    Ext.Msg.confirm(
 		gettext("Notification Target Test"),
-		gettext(`Do you want to send a test notification to '${target}'?`),
+		Ext.String.format(
+		    gettext("Do you want to send a test notification to '{0}'?"),
+		    target
+		),
 		function(decision) {
 		    if (decision !== "yes") {
 			return;
@@ -101,7 +104,10 @@ Ext.define('Proxmox.panel.NotificationEndpointView', {
 			success: function(response, opt) {
 			    Ext.Msg.show({
 				title: gettext('Notification Target Test'),
-				message: gettext(`Sent test notification to '${target}'.`),
+				message: Ext.String.format(
+				    gettext("Sent test notification to '{0}'."),
+				    target
+				),
 				buttons: Ext.Msg.OK,
 				icon: Ext.Msg.INFO,
 			    });
-- 
2.39.2






More information about the pve-devel mailing list