From 8f689f8df0c1d3f78e45f1a8d283ffc258b2160b Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Tue, 24 Jan 2023 22:19:14 +1100 Subject: [PATCH] Translate editpost, move customflag from post to iinclude, and update editpost to properly show board custom flags in the flag slot --- locales/en.json | 5 ++++- locales/pt.json | 5 ++++- views/includes/postflag.pug | 7 +++++++ views/mixins/post.pug | 8 +------- views/pages/editpost.pug | 25 ++++++++++++------------- 5 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 views/includes/postflag.pug diff --git a/locales/en.json b/locales/en.json index 72b226cd..1967230f 100644 --- a/locales/en.json +++ b/locales/en.json @@ -183,6 +183,7 @@ "Hidden User": "Hidden User", "Hide": "Hide", "Hide Username In Modlog": "Hide Username In Modlog", + "Hide Username": "Hide Username", "Home": "Home", "Hover to view": "Hover to view", "I'm sure": "I'm sure", @@ -238,7 +239,8 @@ "None": "None", "Not Shown": "Not Shown", "Note": "Note", - "Nothing": "None", + "Nothing": "Nothing", + "No.": "No.", "Now": "Now", "Opacity": "Opacity", "Open": "Open", @@ -343,6 +345,7 @@ "Upgrade Ban": "Upgrade Ban", "URI e.g. /uri/": "URI e.g. /uri/", "Username": "Username", + "USER WAS BANNED FOR THIS POST": "USER WAS BANNED FOR THIS POST", "Users": "Users", "Watch": "Watch", "Webring": "Webring", diff --git a/locales/pt.json b/locales/pt.json index f702b8bf..3a771e80 100644 --- a/locales/pt.json +++ b/locales/pt.json @@ -226,6 +226,7 @@ "Hidden User": "Esconder", "Hide": "Esconder", "Hide Username In Modlog": "Esconder Username", + "Hide Username": "Esconder Username", "Home": "InĂ­cio", "Hover to view": "Hover to view", "I'm sure": "Tenho a certeza", @@ -287,6 +288,7 @@ "Note": "Nota", "Note: Setting board management permissions on an account/role level will grant them globally i.e for all boards.\nTo make somebody a normal board owner/staff, transfer them the board or give them the appropriate permissions in the board staff permission editing interface.": "Note: Setting board management permissions on an account/role level will grant them globally i.e for all boards.\nTo make somebody a normal board owner/staff, transfer them the board or give them the appropriate permissions in the board staff permission editing interface.", "Nothing": "Nenhuma", + "No.": "/#/", "Now": "Agora", "Opacity": "Opacidade", "Open": "Abrir", @@ -410,7 +412,8 @@ "Use strikethrough": "Use strikethrough", "Use titles": "Use titles", "Use underline": "Use underline", - "Username": "Username", + "Username": "Username", + "USER WAS BANNED FOR THIS POST": "UTILIZADOR FOI BANIDO", "Users": "Utilizadores", "View Raw IPs": "View Raw IPs", "Watch": "+Favorito", diff --git a/views/includes/postflag.pug b/views/includes/postflag.pug new file mode 100644 index 00000000..37e842aa --- /dev/null +++ b/views/includes/postflag.pug @@ -0,0 +1,7 @@ +if post.country.custom === true + span(title=post.country.name) + img.customflag(src=`/flag/${post.board}/${post.country.src}` alt=' ' loading='lazy') + | +else + span(class=`flag flag-${post.country.code.toLowerCase()}` title=post.country.name alt=post.country.name) + | diff --git a/views/mixins/post.pug b/views/mixins/post.pug index f4d293eb..4e9786a7 100644 --- a/views/mixins/post.pug +++ b/views/mixins/post.pug @@ -39,13 +39,7 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false, overboar span.post-name #{post.name} | if post.country && post.country.code - if post.country.custom === true - span(title=post.country.name) - img.customflag(src=`/flag/${post.board}/${post.country.src}` alt=' ' loading='lazy') - | - else - span(class=`flag flag-${post.country.code.toLowerCase()}` title=post.country.name alt=post.country.name) - | + include ../includes/postflag.pug if post.tripcode span.post-tripcode #{post.tripcode} | diff --git a/views/pages/editpost.pug b/views/pages/editpost.pug index 53065667..3d63034f 100644 --- a/views/pages/editpost.pug +++ b/views/pages/editpost.pug @@ -1,10 +1,10 @@ extends ../layout.pug block head - title Edit Post + title #{__('Edit Post')} block content - h1.board-title Edit Post + h1.board-title #{__('Edit Post')} .form-wrapper.flex-center.mv-10 form.form-post(action='/forms/editpost' method='POST') input(type='hidden' name='_csrf' value=csrf) @@ -19,12 +19,11 @@ block content label if !post.thread include ../includes/posticons.pug - input.edit.post-subject(value=post.subject placeholder='Subject' type='text' name='subject' maxlength=globalLimits.fieldLength.subject) - input.edit.post-name(value=post.email type='text' name='email' placeholder='Email' maxlength=globalLimits.fieldLength.email) - input.edit.post-name(type='text' name='name' placeholder='Name' maxlength=globalLimits.fieldLength.name value=post.name+(post.capcode || '')) + input.edit.post-subject(value=post.subject placeholder=__('Subject') type='text' name='subject' maxlength=globalLimits.fieldLength.subject) + input.edit.post-name(value=post.email type='text' name='email' placeholder=__('Email') maxlength=globalLimits.fieldLength.email) + input.edit.post-name(type='text' name='name' placeholder=__('Name') maxlength=globalLimits.fieldLength.name value=post.name+(post.capcode || '')) if post.country && post.country.code - span(class=`flag flag-${post.country.code.toLowerCase()}` title=post.country.name alt=post.country.name) - | + include ../includes/postflag.pug if post.tripcode span.post-tripcode #{post.tripcode} | @@ -38,20 +37,20 @@ block content span.user-id(style=`background-color: #${post.userId}`) #{post.userId} | span.post-links - a.noselect.no-decoration(href=`${postURL}#${post.postId}`) No. + a.noselect.no-decoration(href=`${postURL}#${post.postId}`) #{__('No.')} span.post-quoters a.no-decoration(href=`${postURL}#postform`) #{post.postId} .post-data pre.post-message - textarea.edit.fw(name='message' rows='15' placeholder='Message') #{post.nomarkup} + textarea.edit.fw(name='message' rows='15' placeholder=__('Message')) #{post.nomarkup} if post.banmessage p.ban - span.message USER WAS BANNED FOR THIS POST + span.message #{__('USER WAS BANNED FOR THIS POST')} | span.reason(data-reason=post.banmessage) #{post.banmessage} label.mt-5 input.post-check(type='checkbox', name='hide_name' value='1') - | Hide Username + | #{__('Hide Username')} label.mv-5 - input(type='text', name='log_message', placeholder='Modlog message' autocomplete='off') - input(type='submit', value='Save') + input(type='text', name='log_message', placeholder=__('Modlog message') autocomplete='off') + input(type='submit', value=__('Save'))