From 5db3bedb4ddf7c3a16424de986d0c1bd78c7c378 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Thu, 19 Jan 2023 20:56:48 +1100 Subject: [PATCH] translate postform --- locales/en.json | 18 ++++++++++++++++++ locales/pt.json | 24 +++++++++++++++++++++--- views/includes/postform.pug | 22 +++++++++++----------- views/mixins/filelabel.pug | 2 +- views/mixins/uploaditem.pug | 4 ++-- 5 files changed, 53 insertions(+), 17 deletions(-) diff --git a/locales/en.json b/locales/en.json index c3767c59..df6dad6c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -18,6 +18,24 @@ "New Thread": "New Thread", "New Reply": "New Reply", "Name": "Name", + "Email": "Email", + "Subject": "Subject", + "Message": "Message", + "Files": "Files", + "File": "File", + "Max": "Max", + "total": "total", + "Password": "Password", + "Select/Drop/Paste file": "Select/Drop/Paste file", + "Select/Drop/Paste files": "Select/Drop/Paste files", + "Tegaki": "Tegaki", + "Replayable?": "Replayable?", + "Draw": "Draw", + "Flag": "Flag", + "Spoiler": "Spoiler", + "Strip Filename": "Strip Filename", + "Geographic Flag": "Geographic Flag", + "None": "None", "You": "You", "Index": "Index", "Submit": "Submit", diff --git a/locales/pt.json b/locales/pt.json index 4f1dcd29..a327b08d 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -18,11 +18,29 @@ "New Thread": "Novo Fio", "New Reply": "Nova Resposta", "Name": "Nome", + "Email": "Opção", + "Subject": "Assunto", + "Message": "Mensagem", + "Files": "Ficheiros", + "Files": "Ficheiro", + "Max": "Máx", + "total": "total", + "Password": "Password", + "Select/Drop/Paste file": "Seleciona/Arrasta/Cola ficheiro", + "Select/Drop/Paste files": "Seleciona/Arrasta/Cola ficheiros", + "Tegaki": "Tegaki", + "Replayable?": "Replay?", + "Draw": "Desenhar", + "Flag": "Especial", + "Spoiler": "Spoiler", + "Strip Filename": "Limpar Nome", + "Geographic Flag": "Bandeira Geográfica", + "None": "Nada", "You": "You", "Index": "Index", "Submit": "Enviar", "Block Bypass": "Bypass", - "Your upload was too large": "Your upload was too large *", - "Payload Too Large": "Payload Too Large *", - "Posts must include a message or file": "Posts must include a message or file *" + "Your upload was too large": "Your upload was too large", + "Payload Too Large": "Payload Too Large", + "Posts must include a message or file": "Posts must include a message or file" } diff --git a/views/includes/postform.pug b/views/includes/postform.pug index 9260e26d..eb2b9301 100644 --- a/views/includes/postform.pug +++ b/views/includes/postform.pug @@ -24,17 +24,17 @@ section.form-wrapper.flex-center a.close.postform-style(href='#!') × if board.settings.sageOnlyEmail && !modview section.row - .label Sage + .label #{__('Sage')} label.postform-style.ph-5 input(type='checkbox', name='email', value='sage') else section.row - .label Email + .label #{__('Email')} input(type='text', name='email', autocomplete='off' maxlength=globalLimits.fieldLength.email) include ./subjectfield.pug section.row .label - span Message + span #{__('Message')} if messageRequired span.required * - const minLength = (isThread ? board.settings.minReplyMessageLength : board.settings.minThreadMessageLength) || 0; @@ -44,14 +44,14 @@ section.form-wrapper.flex-center - const maxFiles = board.settings.maxFiles; section.row .label - span File#{maxFiles > 1 ? 's' : ''} + span #{__(`File${maxFiles > 1 ? 's' : ''}`)} if fileRequired span.required * | | if maxFiles > 1 - small Max #{maxFiles} files - small #{postFilesSize} total + small #{__('Max')} #{maxFiles} + small #{postFilesSize} #{__('total')} span.col +filelabel('file', maxFiles) input#file(type='file', name='file' multiple required=fileRequired ) @@ -63,12 +63,12 @@ section.form-wrapper.flex-center | Spoiler if board.settings.enableTegaki && board.settings.allowedFileTypes.image === true section.row.jsonly - .label Tegaki - input.dummy-link.tegaki-button(type='button', value='Draw') + .label #{__('Tegaki')} + input.dummy-link.tegaki-button(type='button', value=__('Draw')) if board.settings.allowedFileTypes.other === true label.noselect.postform-style.ph-5.ml-1.fh input(type='checkbox' name='tegakireplay') - | Replayable? + | #{__('Replayable?')} if board.settings.userPostSpoiler || board.settings.userPostDelete || board.settings.userPostUnlink || modview section.row .label Password @@ -77,9 +77,9 @@ section.form-wrapper.flex-center - const boardFlags = Object.entries(board.flags) if boardFlags.length > 0 section.row - .label Flag + .label #{__('Flag')} select#customflag(name='customflag') - option(value='') #{board.settings.geoFlags === true ? 'Geographic Flag' : 'None'} + option(value='') #{board.settings.geoFlags === true ? __('Geographic Flag') : __('None')} each flag in boardFlags option(value=flag[0] data-src=`/flag/${board._id}/${flag[1]}`) #{flag[0]} img.jsonly#selected-flag diff --git a/views/mixins/filelabel.pug b/views/mixins/filelabel.pug index d9878840..0630687a 100644 --- a/views/mixins/filelabel.pug +++ b/views/mixins/filelabel.pug @@ -1,3 +1,3 @@ mixin filelabel(id, max) label.jsonly.postform-style.filelabel(for=id) - | Select/Drop/Paste file#{max > 1 ? 's' : ''} + | #{__(`Select/Drop/Paste file${max > 1 ? 's' : ''}`)} diff --git a/views/mixins/uploaditem.pug b/views/mixins/uploaditem.pug index 6cd3c112..67caaddd 100644 --- a/views/mixins/uploaditem.pug +++ b/views/mixins/uploaditem.pug @@ -9,8 +9,8 @@ mixin uploaditem(item) if item.spoilers label input(type='checkbox', name='spoiler', value=item.hash) - | Spoiler + | #{__('Spoiler')} if item.stripFilenames label input(type='checkbox', name='strip_filename', value=item.hash) - | Strip Filename + | #{__('Strip Filename')}