From 9672a1ead0fe3437ea172102374d688070aa0f7a Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sat, 28 Jan 2023 14:30:11 +1100 Subject: [PATCH] translate filteractions lib --- lib/post/filteractions.js | 8 ++++---- locales/en.json | 12 +++++++++--- locales/pt.json | 11 ++++++++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/post/filteractions.js b/lib/post/filteractions.js index 7a86be03..86813bf3 100644 --- a/lib/post/filteractions.js +++ b/lib/post/filteractions.js @@ -12,8 +12,8 @@ module.exports = async (req, res, hitGlobalFilter, hitLocalFilter, boardFilterMo if (useFilterMode === 1) { return dynamicResponse(req, res, 400, 'message', { - 'title': 'Bad request', - 'message': 'Your post was blocked by a word filter', + 'title': res.locals.__('Bad request'), + 'message': res.locals.__('Your post was blocked by a word filter'), 'redirect': redirect }); } else { @@ -28,7 +28,7 @@ module.exports = async (req, res, hitGlobalFilter, hitLocalFilter, boardFilterMo }, 'type': res.locals.anonymizer ? 1 : 0, 'range': 0, - 'reason': `${hitGlobalFilter ? 'global ' :''}word filter auto ban`, + 'reason': res.locals.__(`${hitGlobalFilter ? 'global ' :''}word filter auto ban`), 'board': banBoard, 'posts': null, 'issuer': 'system', //todo: make a "system" property instead? @@ -36,7 +36,7 @@ module.exports = async (req, res, hitGlobalFilter, hitLocalFilter, boardFilterMo 'expireAt': banExpiry, 'allowAppeal': hitGlobalFilter ? filterBanAppealable : true, 'showUser': true, - 'note': `${hitGlobalFilter ? 'global ' :''}filter hit: "${hitGlobalFilter || hitLocalFilter}"`, + 'note': res.locals.__(`${hitGlobalFilter ? 'global ' :''}filter hit: "%s"`, (hitGlobalFilter || hitLocalFilter)), 'seen': true, }; const insertedResult = await Bans.insertOne(ban); diff --git a/locales/en.json b/locales/en.json index 4edb8952..a0c179f1 100644 --- a/locales/en.json +++ b/locales/en.json @@ -71,6 +71,7 @@ "one": "%s year from now", "other": "%s years from now" }, + "⊖ Thread has reached reply limit.": "⊖ Thread has reached reply limit.", "24h time": "24h time", "2FA Code": "2FA Code", "6 digits": "6 digits", @@ -132,6 +133,7 @@ }, "Assets": "Assets", "Attempting to reconnect...": "Attempting to reconnect...", + "Bad request": "Bad request", "Ban duration e.g. 7d": "Ban duration e.g. 7d", "Ban Poster": "Ban Poster", "Ban reason": "Ban reason", @@ -275,6 +277,7 @@ "other": "Files" }, "Filter": "Filter", + "filter hit: \"%s\"": "filter hit: \"%s\"", "Filter ID": "Filter ID", "Filter Name": "Filter Name", "Filter Subject": "Filter Subject", @@ -301,12 +304,14 @@ "Global Bans": "Global Bans", "Global Board Owner": "Global Board Owner", "Global Board Staff": "Global Board Staff", + "global filter hit: \"%s\"": "global filter hit: \"%s\"", "Global Logs": "Global Logs", "Global Management": "Global Management", "Global post history for %s": "Global post history for %s", "Global Report": "Global Report", "Global Settings": "Global Settings", "Global Staff": "Global Staff", + "global word filter auto ban": "global word filter auto ban", "Greentext": "Greentext", "Hidden images": "Hidden images", "Hidden User": "Hidden User", @@ -379,6 +384,7 @@ "Message": "Message", "Mod Catalog": "Mod Catalog", "Mod Index": "Mod Index", + "Mod View": "Mod View", "Moderate": "Moderate", "Modlog message": "Modlog message", "Move": "Move", @@ -597,12 +603,12 @@ "Welcome, %s": "Welcome, %s", "Wide": "Wide", "Wide Range": "Wide Range", + "word filter auto ban": "word filter auto ban", "You": "You", "You moderate": "You moderate", "You own": "You own", "You will be redirected shortly.": "You will be redirected shortly.", + "Your post was blocked by a word filter": "Your post was blocked by a word filter", "Your upload was too large": "Your upload was too large", - "⊖ Thread has reached reply limit.": "⊖ Thread has reached reply limit.", - "Mod View": "Mod View", "Zoom": "Zoom" -} +} \ No newline at end of file diff --git a/locales/pt.json b/locales/pt.json index b732346c..de22d001 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -71,6 +71,7 @@ "one": "%s ano desde agora", "other": "%s anos desde agora" }, + "⊖ Thread has reached reply limit.": "⊖ O fio foi trancado.", "24h time": "Hora 24h", "2FA Code": "Código 2FA", "6 digits": "6 digitos", @@ -275,6 +276,7 @@ "other": "Ficheiros" }, "Filter": "Filtrar", + "filter hit: \"%s\"": "filter hit: \"%s\"", "Filter ID": "Filtrar ID", "Filter Name": "Filtrar Nome", "Filter Subject": "Filtrar Assunto", @@ -301,12 +303,14 @@ "Global Bans": "Global Bans", "Global Board Owner": "Global Board Owner", "Global Board Staff": "Global Board Staff", + "global filter hit: \"%s\"": "global filter hit: \"%s\"", "Global Logs": "Global Logs", "Global Management": "Global Management", "Global post history for %s": "Global post history for %s", "Global Report": "Denúncia Global", "Global Settings": "Opções Globais", "Global Staff": "Global Staff", + "global word filter auto ban": "global word filter auto ban", "Greentext": "Greentext", "Hidden images": "Imagens escondidas", "Hidden User": "Esconder", @@ -379,6 +383,7 @@ "Message": "Mensagem", "Mod Catalog": "Mod Catálogo", "Mod Index": "Mod Index", + "Mod View": "Mod View", "Moderate": "Denúnciar/Moderar", "Modlog message": "Mensagem Modlog", "Move": "Move", @@ -597,12 +602,12 @@ "Welcome, %s": "Bem-vindo, %s", "Wide": "Longo", "Wide Range": "Range Longo", + "word filter auto ban": "word filter auto ban", "You": "You", "You moderate": "Que moderas", "You own": "Que administras", "You will be redirected shortly.": "Vais ser redirecionado em breve", + "Your post was blocked by a word filter": "Your post was blocked by a word filter", "Your upload was too large": "Your upload was too large", - "⊖ Thread has reached reply limit.": "⊖ O fio foi trancado.", - "Mod View": "Mod View", "Zoom": "Zoom" -} +} \ No newline at end of file