add i18n functions to more models, machine translate for RU

indiachan-spamvector
Thomas Lynch 1 year ago
parent 745b4a28b9
commit 426bf4c4b3
  1. 33
      locales/en.json
  2. 31
      locales/pt.json
  3. 33
      locales/ru.json
  4. 14
      models/forms/addassets.js
  5. 2
      models/forms/addcustompage.js
  6. 10
      models/forms/addflags.js
  7. 2
      models/forms/addnews.js
  8. 2
      models/forms/addstaff.js
  9. 4
      models/forms/banposter.js
  10. 2
      models/forms/blockbypass.js
  11. 2
      models/forms/bumplockposts.js
  12. 18
      models/forms/uploadbanners.js

@ -1,6 +1,5 @@
{ {
".html name": ".html name", ".html name": ".html name",
"'Malformed IP": "'Malformed IP",
"(You)": "(You)", "(You)": "(You)",
"(You)s": "(You)s", "(You)s": "(You)s",
"%s characters": { "%s characters": {
@ -121,6 +120,13 @@
"Add layer": "Add layer", "Add layer": "Add layer",
"Add News": "Add News", "Add News": "Add News",
"Add Staff": "Add Staff", "Add Staff": "Add Staff",
"Added %s bans": {
"one": "Added %s ban",
"other": "Added %s bans"
},
"Added custom page": "Added custom page",
"Added newspost": "Added newspost",
"Added staff": "Added staff",
"Admin": "Admin", "Admin": "Admin",
"Airbrush": "Airbrush", "Airbrush": "Airbrush",
"alphanumeric only": "alphanumeric only", "alphanumeric only": "alphanumeric only",
@ -137,6 +143,10 @@
"one": "Asset", "one": "Asset",
"other": "Assets" "other": "Assets"
}, },
"Asset already exist": {
"one": "Asset already exists",
"other": "Assets already exist"
},
"Assets": "Assets", "Assets": "Assets",
"Attempting to reconnect...": "Attempting to reconnect...", "Attempting to reconnect...": "Attempting to reconnect...",
"Bad request": "Bad request", "Bad request": "Bad request",
@ -200,6 +210,7 @@
"Code theme": "Code theme", "Code theme": "Code theme",
"Color": "Color", "Color": "Color",
"comma separated": "comma separated", "comma separated": "comma separated",
"Completed block bypass, you may go back and make your post.": "Completed block bypass, you may go back and make your post.",
"Confirm New Password": "Confirm New Password", "Confirm New Password": "Confirm New Password",
"Confirm Password": "Confirm Password", "Confirm Password": "Confirm Password",
"Connected for live posts": "Connected for live posts", "Connected for live posts": "Connected for live posts",
@ -352,6 +363,9 @@
"Inline Monospace": "Inline Monospace", "Inline Monospace": "Inline Monospace",
"Internal server error": "Internal server error", "Internal server error": "Internal server error",
"Invalid dimensions.": "Invalid dimensions.", "Invalid dimensions.": "Invalid dimensions.",
"Invalid file \"%s\". Max banner dimensions are %sx%s and must be a 3:1 aspect ratio.": "Invalid file \"%s\". Max banner dimensions are %sx%s and must be a 3:1 aspect ratio.",
"Invalid file \"%s\". Max banner dimensions are %sx%s.": "Invalid file \"%s\". Max banner dimensions are %sx%s.",
"Invalid file type for %s. Mimetype %s not allowed.": "Invalid file type for %s. Mimetype %s not allowed.",
"Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Invalid or missing \"Referer\" header. Are you posting from the correct URL?", "Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Invalid or missing \"Referer\" header. Are you posting from the correct URL?",
"IP": "IP", "IP": "IP",
"IP/Hash": "IP/Hash", "IP/Hash": "IP/Hash",
@ -386,6 +400,7 @@
"Loop audio/video": "Loop audio/video", "Loop audio/video": "Loop audio/video",
"Make links clickable": "Make links clickable", "Make links clickable": "Make links clickable",
"Malformed input": "Malformed input", "Malformed input": "Malformed input",
"Malformed IP": "'Malformed IP",
"Manage": "Manage", "Manage": "Manage",
"Manage Custom Pages": "Manage Custom Pages", "Manage Custom Pages": "Manage Custom Pages",
"Manage News": "Manage News", "Manage News": "Manage News",
@ -403,6 +418,7 @@
"Merge layers": "Merge layers", "Merge layers": "Merge layers",
"Merge selected layers?": "Merge selected layers?", "Merge selected layers?": "Merge selected layers?",
"Message": "Message", "Message": "Message",
"Mime type mismatch for file \"%s\"": "Mime type mismatch for file \"%s\"",
"Missing file extensions": "Missing file extensions", "Missing file extensions": "Missing file extensions",
"Mod Catalog": "Mod Catalog", "Mod Catalog": "Mod Catalog",
"Mod Index": "Mod Index", "Mod Index": "Mod Index",
@ -433,6 +449,7 @@
"No news.": "No news.", "No news.": "No news.",
"No Permission": "No Permission", "No Permission": "No Permission",
"No posts.": "No posts.", "No posts.": "No posts.",
"No reason specified": "No reason specified",
"No reports.": "No reports.", "No reports.": "No reports.",
"No results.": "No results.", "No results.": "No results.",
"No video/audio files in this thread.": "No video/audio files in this thread.", "No video/audio files in this thread.": "No video/audio files in this thread.",
@ -604,6 +621,18 @@
"Update": "Update", "Update": "Update",
"Updated": "Updated", "Updated": "Updated",
"Upgrade Ban": "Upgrade Ban", "Upgrade Ban": "Upgrade Ban",
"Uploaded %s new assets.": {
"one": "Uploaded %s new asset.",
"other": "Uploaded %s new assets."
},
"Uploaded %s new banners.": {
"one": "Uploaded %s new banner.",
"other": "Uploaded %s new banners."
},
"Uploaded %s new flags.": {
"one": "Uploaded %s new flag.",
"other": "Uploaded %s new flags."
},
"URI e.g. /uri/": "URI e.g. /uri/", "URI e.g. /uri/": "URI e.g. /uri/",
"URI or tags": "URI or tags", "URI or tags": "URI or tags",
"Use bold": "Use bold", "Use bold": "Use bold",
@ -643,4 +672,4 @@
"Your request was blocked because your IP address is listed on a blacklist.": "Your request was blocked because your IP address is listed on a blacklist.", "Your request was blocked because your IP address is listed on a blacklist.": "Your request was blocked because your IP address is listed on a blacklist.",
"Your upload was too large": "Your upload was too large", "Your upload was too large": "Your upload was too large",
"Zoom": "Zoom" "Zoom": "Zoom"
} }

@ -1,6 +1,5 @@
{ {
".html name": ".html nome", ".html name": ".html nome",
"'Malformed IP": "'Malformed IP",
"(You)": "(You)", "(You)": "(You)",
"(You)s": "(You)s", "(You)s": "(You)s",
"%s characters": { "%s characters": {
@ -121,6 +120,13 @@
"Add layer": "Adicionar camada", "Add layer": "Adicionar camada",
"Add News": "Add News", "Add News": "Add News",
"Add Staff": "Adicionar Staff", "Add Staff": "Adicionar Staff",
"Added %s bans": {
"one": "Added %s ban",
"other": "Added %s bans"
},
"Added custom page": "Added custom page",
"Added newspost": "Added newspost",
"Added staff": "Added staff",
"Admin": "Admin", "Admin": "Admin",
"Airbrush": "Aerógrafo", "Airbrush": "Aerógrafo",
"alphanumeric only": "Alfanumérico apenas", "alphanumeric only": "Alfanumérico apenas",
@ -137,6 +143,10 @@
"one": "Asset", "one": "Asset",
"other": "Assets" "other": "Assets"
}, },
"Asset already exist": {
"one": "Asset already exists",
"other": "Assets already exist"
},
"Assets": "Assets", "Assets": "Assets",
"Attempting to reconnect...": "A ligar...", "Attempting to reconnect...": "A ligar...",
"Bad request": "Bad request", "Bad request": "Bad request",
@ -200,6 +210,7 @@
"Code theme": "Tema código", "Code theme": "Tema código",
"Color": "Cor", "Color": "Cor",
"comma separated": "separado por vírgula", "comma separated": "separado por vírgula",
"Completed block bypass, you may go back and make your post.": "Completed block bypass, you may go back and make your post.",
"Confirm New Password": "Confirm New Password", "Confirm New Password": "Confirm New Password",
"Confirm Password": "Confirmar Password", "Confirm Password": "Confirmar Password",
"Connected for live posts": "Ligado", "Connected for live posts": "Ligado",
@ -352,6 +363,9 @@
"Inline Monospace": "Inline Monospace", "Inline Monospace": "Inline Monospace",
"Internal server error": "Erro interno do servidor", "Internal server error": "Erro interno do servidor",
"Invalid dimensions.": "Dimensões invalidas.", "Invalid dimensions.": "Dimensões invalidas.",
"Invalid file \"%s\". Max banner dimensions are %sx%s and must be a 3:1 aspect ratio.": "Invalid file \"%s\". Max banner dimensions are %sx%s and must be a 3:1 aspect ratio.",
"Invalid file \"%s\". Max banner dimensions are %sx%s.": "Invalid file \"%s\". Max banner dimensions are %sx%s.",
"Invalid file type for %s. Mimetype %s not allowed.": "Invalid file type for %s. Mimetype %s not allowed.",
"Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Invalid or missing \"Referer\" header. Are you posting from the correct URL?", "Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Invalid or missing \"Referer\" header. Are you posting from the correct URL?",
"IP": "IP", "IP": "IP",
"IP/Hash": "IP/Hash", "IP/Hash": "IP/Hash",
@ -386,6 +400,7 @@
"Loop audio/video": "Loop áudio/vídeo", "Loop audio/video": "Loop áudio/vídeo",
"Make links clickable": "Make links clickable", "Make links clickable": "Make links clickable",
"Malformed input": "Malformed input", "Malformed input": "Malformed input",
"Malformed IP": "'Malformed IP",
"Manage": "Gerir", "Manage": "Gerir",
"Manage Custom Pages": "Gerir Páginas", "Manage Custom Pages": "Gerir Páginas",
"Manage News": "Manage News", "Manage News": "Manage News",
@ -403,6 +418,7 @@
"Merge layers": "Fundir camadas", "Merge layers": "Fundir camadas",
"Merge selected layers?": "Fundir camadas selecionadas?", "Merge selected layers?": "Fundir camadas selecionadas?",
"Message": "Mensagem", "Message": "Mensagem",
"Mime type mismatch for file \"%s\"": "Mime type mismatch for file \"%s\"",
"Missing file extensions": "Missing file extensions", "Missing file extensions": "Missing file extensions",
"Mod Catalog": "Mod Catálogo", "Mod Catalog": "Mod Catálogo",
"Mod Index": "Mod Index", "Mod Index": "Mod Index",
@ -433,6 +449,7 @@
"No news.": "Sem notícias.", "No news.": "Sem notícias.",
"No Permission": "No Permission", "No Permission": "No Permission",
"No posts.": "Sem publicações.", "No posts.": "Sem publicações.",
"No reason specified": "No reason specified",
"No reports.": "Sem denúncias.", "No reports.": "Sem denúncias.",
"No results.": "No results.", "No results.": "No results.",
"No video/audio files in this thread.": "No video/audio files in this thread.", "No video/audio files in this thread.": "No video/audio files in this thread.",
@ -604,6 +621,18 @@
"Update": "Atualizar", "Update": "Atualizar",
"Updated": "Atualizado", "Updated": "Atualizado",
"Upgrade Ban": "Alterar Range", "Upgrade Ban": "Alterar Range",
"Uploaded %s new assets.": {
"one": "Uploaded %s new asset.",
"other": "Uploaded %s new assets."
},
"Uploaded %s new banners.": {
"one": "Uploaded %s new banner.",
"other": "Uploaded %s new banners."
},
"Uploaded %s new flags.": {
"one": "Uploaded %s new flag.",
"other": "Uploaded %s new flags."
},
"URI e.g. /uri/": "URI e.g. /uri/", "URI e.g. /uri/": "URI e.g. /uri/",
"URI or tags": "URI or tags", "URI or tags": "URI or tags",
"Use bold": "Use bold", "Use bold": "Use bold",

@ -1,6 +1,5 @@
{ {
".html name": ".html name", ".html name": ".html name",
"'Malformed IP": "'Неправильный IP",
"(You)": "(Вы)", "(You)": "(Вы)",
"(You)s": "(Вы) s", "(You)s": "(Вы) s",
"%s characters": { "%s characters": {
@ -121,6 +120,13 @@
"Add layer": "Добавить слой", "Add layer": "Добавить слой",
"Add News": "Добавить новости", "Add News": "Добавить новости",
"Add Staff": "Добавить персонал", "Add Staff": "Добавить персонал",
"Added %s bans": {
"one": "Добавлен %s бан",
"other": "Добавлено %s запретов"
},
"Added custom page": "Добавлена пользовательская страница",
"Added newspost": "Добавлена публикация новостей",
"Added staff": "Добавленный персонал",
"Admin": "Администратор", "Admin": "Администратор",
"Airbrush": "Аэрография", "Airbrush": "Аэрография",
"alphanumeric only": "только буквенно-цифровой", "alphanumeric only": "только буквенно-цифровой",
@ -137,6 +143,10 @@
"one": "Актив", "one": "Актив",
"other": "Активы" "other": "Активы"
}, },
"Asset already exist": {
"one": "Актив уже существует",
"other": "Активы уже существуют"
},
"Assets": "Активы", "Assets": "Активы",
"Attempting to reconnect...": "Попытка повторного подключения ...", "Attempting to reconnect...": "Попытка повторного подключения ...",
"Bad request": "Неверный запрос", "Bad request": "Неверный запрос",
@ -200,6 +210,7 @@
"Code theme": "Тема кода", "Code theme": "Тема кода",
"Color": "Цвет", "Color": "Цвет",
"comma separated": "через запятую", "comma separated": "через запятую",
"Completed block bypass, you may go back and make your post.": "Завершив обход блока, вы можете вернуться и сделать свой пост.",
"Confirm New Password": "Подтвердить новый пароль", "Confirm New Password": "Подтвердить новый пароль",
"Confirm Password": "Подтвердить пароль", "Confirm Password": "Подтвердить пароль",
"Connected for live posts": "Подключено для живые сообщения", "Connected for live posts": "Подключено для живые сообщения",
@ -352,6 +363,9 @@
"Inline Monospace": "Встроенное моноширинное пространство", "Inline Monospace": "Встроенное моноширинное пространство",
"Internal server error": "Внутренняя ошибка сервера", "Internal server error": "Внутренняя ошибка сервера",
"Invalid dimensions.": "Недопустимые измерения", "Invalid dimensions.": "Недопустимые измерения",
"Invalid file \"%s\". Max banner dimensions are %sx%s and must be a 3:1 aspect ratio.": "Недопустимый файл \"%s\". Максимальные размеры баннера составляют %sx%s и должны иметь соотношение сторон 3:1.",
"Invalid file \"%s\". Max banner dimensions are %sx%s.": "Недопустимый файл \"%s\". Максимальные размеры баннера составляют %sx%s.",
"Invalid file type for %s. Mimetype %s not allowed.": "Недопустимый тип файла для %s. Mimetype %s не разрешен.",
"Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Недопустимый или отсутствующий заголовок \"Refererer\". Вы отправляете сообщения с правильного URL-адреса?", "Invalid or missing \"Referer\" header. Are you posting from the correct URL?": "Недопустимый или отсутствующий заголовок \"Refererer\". Вы отправляете сообщения с правильного URL-адреса?",
"IP": "IP", "IP": "IP",
"IP/Hash": "IP / Hash", "IP/Hash": "IP / Hash",
@ -386,6 +400,7 @@
"Loop audio/video": "Цикл аудио / видео", "Loop audio/video": "Цикл аудио / видео",
"Make links clickable": "Сделать ссылки интерактивными", "Make links clickable": "Сделать ссылки интерактивными",
"Malformed input": "Неправильный ввод", "Malformed input": "Неправильный ввод",
"Malformed IP": "'Неправильный IP",
"Manage": "Управление", "Manage": "Управление",
"Manage Custom Pages": "Управление пользовательскими страницами", "Manage Custom Pages": "Управление пользовательскими страницами",
"Manage News": "Управление новостями", "Manage News": "Управление новостями",
@ -403,6 +418,7 @@
"Merge layers": "Объединить слои", "Merge layers": "Объединить слои",
"Merge selected layers?": "Объединить выбранные слои?", "Merge selected layers?": "Объединить выбранные слои?",
"Message": "Сообщение", "Message": "Сообщение",
"Mime type mismatch for file \"%s\"": "Несоответствие типа Mime для файла \"%s\"",
"Missing file extensions": "Отсутствующие расширения файлов", "Missing file extensions": "Отсутствующие расширения файлов",
"Mod Catalog": "Каталог модов", "Mod Catalog": "Каталог модов",
"Mod Index": "Индекс модов", "Mod Index": "Индекс модов",
@ -433,6 +449,7 @@
"No news.": "Нет новостей", "No news.": "Нет новостей",
"No Permission": "Нет разрешения", "No Permission": "Нет разрешения",
"No posts.": "Нет сообщений.", "No posts.": "Нет сообщений.",
"No reason specified": "Причина не указана",
"No reports.": "Нет отчетов.", "No reports.": "Нет отчетов.",
"No results.": "Нет результатов.", "No results.": "Нет результатов.",
"No video/audio files in this thread.": "Нет видео / аудио файлов в этой теме.", "No video/audio files in this thread.": "Нет видео / аудио файлов в этой теме.",
@ -604,6 +621,18 @@
"Update": "Обновить", "Update": "Обновить",
"Updated": "Обновлено", "Updated": "Обновлено",
"Upgrade Ban": "Запрет на обновление", "Upgrade Ban": "Запрет на обновление",
"Uploaded %s new assets.": {
"one": "загружен %s новый актив.",
"other": "загружено %s новых активов."
},
"Uploaded %s new banners.": {
"one": "загружен 1 новый баннер.",
"other": "загружено %s новых баннеров."
},
"Uploaded %s new flags.": {
"one": "загружен %s новый флаг.",
"other": "загружено %s новых флагов."
},
"URI e.g. /uri/": "URI, например / uri /", "URI e.g. /uri/": "URI, например / uri /",
"URI or tags": "URI или теги", "URI or tags": "URI или теги",
"Use bold": "Использовать жирный шрифт", "Use bold": "Использовать жирный шрифт",
@ -643,4 +672,4 @@
"Your request was blocked because your IP address is listed on a blacklist.": "Ваш запрос был заблокирован, потому что ваш IP-адрес внесен в черный список.", "Your request was blocked because your IP address is listed on a blacklist.": "Ваш запрос был заблокирован, потому что ваш IP-адрес внесен в черный список.",
"Your upload was too large": "Ваша загрузка была слишком большой", "Your upload was too large": "Ваша загрузка была слишком большой",
"Zoom": "Увеличить" "Zoom": "Увеличить"
} }

@ -24,8 +24,8 @@ module.exports = async (req, res) => {
})) { })) {
await deleteTempFiles(req).catch(console.error); await deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Invalid file type for ${req.files.file[i].name}. Mimetype ${req.files.file[i].mimetype} not allowed.`, 'message': res.locals.__('Invalid file type for %s. Mimetype %s not allowed.', req.files.file[i].name, req.files.file[i].mimetype),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -34,8 +34,8 @@ module.exports = async (req, res) => {
if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) { if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) {
deleteTempFiles(req).catch(console.error); deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Mime type mismatch for file "${req.files.file[i].name}"`, 'message': res.locals.__('Mime type mismatch for file "%s"', req.files.file[i].name),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -71,8 +71,8 @@ module.exports = async (req, res) => {
// no new assets // no new assets
if (filenames.length === 0) { if (filenames.length === 0) {
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Asset${res.locals.numFiles > 1 ? 's' : ''} already exist${res.locals.numFiles > 1 ? '' : 's'}`, 'message': res.locals.__n('Asset already exist', res.locals.numFiles),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -85,7 +85,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': `Uploaded ${filenames.length} new assets.`, 'message': res.locals.__n('Uploaded %s new assets.', filenames.length),
'redirect': redirect 'redirect': redirect
}); });

@ -37,7 +37,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': 'Added custom page', 'message': res.locals.__('Added custom page'),
'redirect': `/${req.params.board}/manage/custompages.html` 'redirect': `/${req.params.board}/manage/custompages.html`
}); });

@ -28,8 +28,8 @@ module.exports = async (req, res) => {
})) { })) {
await deleteTempFiles(req).catch(console.error); await deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Invalid file type for ${req.files.file[i].name}. Mimetype ${req.files.file[i].mimetype} not allowed.`, 'message': res.locals.__('Invalid file type for %s. Mimetype %s not allowed.', req.files.file[i].name, req.files.file[i].mimetype),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -41,8 +41,8 @@ module.exports = async (req, res) => {
if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) { if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) {
deleteTempFiles(req).catch(console.error); deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Mime type mismatch for file "${req.files.file[i].name}"`, 'message': res.locals.__('Mime type mismatch for file "%s"', req.files.file[i].name),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -96,7 +96,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': `Uploaded ${res.locals.numFiles} new flags.`, 'message': res.locals.__('Uploaded %s new flags.', res.locals.numFiles),
'redirect': redirect 'redirect': redirect
}); });

@ -30,7 +30,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': 'Added newspost', 'message': res.locals.__('Added newspost'),
'redirect': '/globalmanage/news.html' 'redirect': '/globalmanage/news.html'
}); });

@ -13,7 +13,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': 'Added staff', 'message': res.locals.__('Added staff'),
'redirect': `/${req.params.board}/manage/staff.html`, 'redirect': `/${req.params.board}/manage/staff.html`,
}); });

@ -8,7 +8,7 @@ module.exports = async (req, res) => {
const { defaultBanDuration } = config.get; const { defaultBanDuration } = config.get;
const banDate = new Date(); const banDate = new Date();
const banExpiry = new Date(banDate.getTime() + (req.body.ban_duration || defaultBanDuration)); //uses config default if missing or malformed const banExpiry = new Date(banDate.getTime() + (req.body.ban_duration || defaultBanDuration)); //uses config default if missing or malformed
const banReason = req.body.ban_reason || req.body.log_message || 'No reason specified'; const banReason = req.body.ban_reason || req.body.log_message || res.locals.__('No reason specified');
const allowAppeal = (req.body.no_appeal || req.body.ban_q || req.body.ban_h) ? false : true; //dont allow appeals for range bans const allowAppeal = (req.body.no_appeal || req.body.ban_q || req.body.ban_h) ? false : true; //dont allow appeals for range bans
const bans = []; const bans = [];
@ -105,7 +105,7 @@ module.exports = async (req, res) => {
const numBans = await Bans.insertMany(bans).then(result => result.insertedCount); const numBans = await Bans.insertMany(bans).then(result => result.insertedCount);
const query = { const query = {
message: `Added ${numBans} bans`, message: res.locals.__n('Added %s bans', numBans),
}; };
if ((req.body.ban || req.body.global_ban ) && req.body.ban_reason) { if ((req.body.ban || req.body.global_ban ) && req.body.ban_reason) {

@ -23,7 +23,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'minimal': req.body.minimal, 'minimal': req.body.minimal,
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': 'Completed block bypass, you may go back and make your post.', 'message': res.locals.__('Completed block bypass, you may go back and make your post.'),
}); });
}; };

@ -10,7 +10,7 @@ module.exports = (posts) => {
if (filteredposts.length === 0) { if (filteredposts.length === 0) {
return { return {
message: 'No thread(s) to bumplock', message: 'No threads to bumplock',
}; };
} }

@ -27,8 +27,8 @@ module.exports = async (req, res) => {
})) { })) {
await deleteTempFiles(req).catch(console.error); await deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Invalid file type for ${req.files.file[i].name}. Mimetype ${req.files.file[i].mimetype} not allowed.`, 'message': res.locals.__('Invalid file type for %s. Mimetype %s not allowed.', req.files.file[i].name, req.files.file[i].mimetype),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -38,8 +38,8 @@ module.exports = async (req, res) => {
if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) { if (!(await mimeTypes.realMimeCheck(req.files.file[i]))) {
deleteTempFiles(req).catch(console.error); deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Mime type mismatch for file "${req.files.file[i].name}"`, 'message': res.locals.__('Mime type mismatch for file "%s"', req.files.file[i].name),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -57,8 +57,8 @@ module.exports = async (req, res) => {
&& (geometry.width/geometry.height !== 3))) { && (geometry.width/geometry.height !== 3))) {
await deleteTempFiles(req).catch(console.error); await deleteTempFiles(req).catch(console.error);
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Invalid file ${req.files.file[i].name}. Max banner dimensions are ${globalLimits.bannerFiles.width}x${globalLimits.bannerFiles.height}${globalLimits.bannerFiles.forceAspectRatio === true ? ' and must be a 3:1 aspect ratio' : '' }.`, 'message': res.locals.__(`Invalid file "%s". Max banner dimensions are %sx%s${globalLimits.bannerFiles.forceAspectRatio === true ? ' and must be a 3:1 aspect ratio' : '' }.`, req.files.file[i].name, globalLimits.bannerFiles.width, globalLimits.bannerFiles.height),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -93,8 +93,8 @@ module.exports = async (req, res) => {
// no new banners // no new banners
if (filenames.length === 0) { if (filenames.length === 0) {
return dynamicResponse(req, res, 400, 'message', { return dynamicResponse(req, res, 400, 'message', {
'title': 'Bad request', 'title': res.locals.__('Bad request'),
'message': `Banner${res.locals.numFiles > 1 ? 's' : ''} already exist${res.locals.numFiles > 1 ? '' : 's'}`, 'message': res.locals.__n('Banner already exist', res.locals.numFiles),
'redirect': redirect 'redirect': redirect
}); });
} }
@ -117,7 +117,7 @@ module.exports = async (req, res) => {
return dynamicResponse(req, res, 200, 'message', { return dynamicResponse(req, res, 200, 'message', {
'title': res.locals.__('Success'), 'title': res.locals.__('Success'),
'message': `Uploaded ${filenames.length} new banners.`, 'message': res.locals.__n('Uploaded %s new banners.', filenames.length),
'redirect': redirect 'redirect': redirect
}); });

Loading…
Cancel
Save