Node.js based forum software built for the modern web
fix: closes #13872, use translator.compile for notification text
Barış Soner Uşaklı5a031d01e6da
diff --git a/src/socket.io/helpers.js b/src/socket.io/helpers.jsindex 5def5138d4..194602f1b3 100644--- a/src/socket.io/helpers.js+++ b/src/socket.io/helpers.js@@ -13,6 +13,7 @@ const notifications = require('../notifications');const plugins = require('../plugins');const utils = require('../utils');const batch = require('../batch');+const translator = require('../translator');const SocketHelpers = module.exports;@@ -113,10 +114,11 @@ SocketHelpers.sendNotificationToPostOwner = async function (pid, fromuid, commanconst title = utils.decodeHTMLEntities(topicTitle);const titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');+ const bodyShort = translator.compile(notification, userData.displayname || userData.name, titleEscaped);const notifObj = await notifications.create({type: command,- bodyShort: `[[${notification}, ${userData.displayname || userData.name}, ${titleEscaped}]]`,+ bodyShort: bodyShort,bodyLong: postObj.content,pid: pid,tid: postData.tid,