A bunch more translations, and change a log to alert() in ptchina-playlist

indiachan-spamvector
Thomas Lynch 1 year ago
parent 8ddaee00ca
commit cb326823cb
  1. 8
      gulp/res/js/captcha.js
  2. 3
      gulp/res/js/ptchina-playlist.js
  3. 33
      locales/en.json
  4. 33
      locales/pt.json
  5. 6
      views/includes/actionfooter.pug
  6. 6
      views/includes/actionfooter_globalmanage.pug
  7. 6
      views/includes/actionfooter_manage.pug
  8. 2
      views/includes/boardpages.pug
  9. 6
      views/includes/captcha.pug
  10. 2
      views/includes/pages.pug
  11. 2
      views/includes/postform.pug
  12. 17
      views/mixins/catalogtile.pug
  13. 18
      views/mixins/post.pug
  14. 2
      views/mixins/threadwatcher.pug
  15. 12
      views/pages/catalog.pug
  16. 10
      views/pages/overboardcatalog.pug

@ -1,4 +1,4 @@
/* globals captchaOptions captchaformsection */
/* globals __ captchaOptions captchaformsection */
const captchaCookieRegex = /captchaid=(.[^;]*)/ig;
class CaptchaController {
@ -46,7 +46,7 @@ class CaptchaController {
//captcha.parentElement.previousSibling.previousSibling.tagName === 'SUMMARY' ? captcha.parentElement.previousSibling.previousSibling : captcha.parentElement;
hoverListener.addEventListener('mouseover', () => this.loadCaptcha(captcha), { once: true });
} else { //captchaOptions.type === 'text'
captcha.placeholder = 'focus to load captcha';
captcha.placeholder = __('focus to load captcha');
captcha.addEventListener('focus', () => this.loadCaptcha(captcha), { once: true });
}
}
@ -117,12 +117,12 @@ class CaptchaController {
refreshDiv.addEventListener('click', (e) => this.refreshCaptchas(e), true);
refreshDiv.textContent = '↻';
if (captchaOptions.type === 'text') {
field.placeholder = 'loading';
field.placeholder = __('loading');
}
captchaImg.src = imgSrc;
captchaImg.onload = () => {
if (captchaOptions.type === 'text') {
field.placeholder = 'Captcha text';
field.placeholder = __('Captcha text');
}
captchaDiv.appendChild(captchaImg);
captchaDiv.appendChild(refreshDiv);

@ -1,3 +1,4 @@
/* globals __ */
//https://github.com/ussaohelcim/ptchina-playlist/tree/bookmarklet-let
async function threadToPlaylist(board, postId) {
async function getThread() {
@ -56,7 +57,7 @@ async function threadToPlaylist(board, postId) {
if (playlist.split('\n').length > 1) {
downloadPlaylist(`${thread.board}-${thread.postId}.m3u`, playlist);
} else {
console.log('No video/audio files in this thread.');
alert(__('No video/audio files in this thread.'));
}
} catch (error) {
console.log(error);

@ -25,6 +25,39 @@
"one": "File",
"other": "Files"
},
"Replies": {
"one": "Reply",
"other": "Replies"
},
"Thread Watcher": "Thread Watcher",
"Captcha text": "Captcha text",
"Please enable JavaScript to solve the captcha.": "Please enable JavaScript to solve the captcha.",
"%s characters": {
"one": "%s character",
"other": "%s characters"
},
"No video/audio files in this thread.": "No video/audio files in this thread.",
"focus to load captcha": "focus to load captcha",
"loading": "loading",
"Page": "Page",
"Hide": "Hide",
"Filter Name": "Filter Name",
"Filter Subject": "Filter Subject",
"Filter ID": "Filter ID",
"Filter Tripcode": "Filter Tripcode",
"Moderate": "Moderate",
"Edit": "Edit",
"Watch": "Watch",
"Playlist": "Playlist",
"Filter": "Filter",
"Sort By": "Sort By",
"Bump Order": "Bump Order",
"Creation Date": "Creation Date",
"Reply Count": "Reply Count",
"No posts.": "Sem publicações.",
"Show Post Actions": "Show Post Actions",
"Actions": "Actions",
"Submit": "Submit",
"Max %s files": {
"one": "Max %s file",
"other": "Max %s files"

@ -25,6 +25,39 @@
"one": "Ficheiro",
"other": "Ficheiros"
},
"Replies": {
"one": "Reposta",
"other": "Repostas"
},
"Captcha text": "Código captcha",
"Please enable JavaScript to solve the captcha.": "Necessita JavaScript.",
"%s characters": {
"one": "%s caracter",
"other": "%s caracteres"
},
"No video/audio files in this thread.": "No video/audio files in this thread.",
"focus to load captcha": "Seleciona para carregar captcha",
"loading": "loading",
"Page": "Página",
"Hide": "Esconder",
"Filter Name": "Filtrar Nome",
"Filter Subject": "Filtrar Assunto",
"Filter ID": "Filtrar ID",
"Filter Tripcode": "Filtrar Tripcode",
"Moderate": "Filtrar Nome",
"Edit": "Editar",
"Watch": "+Favorito",
"Thread Watcher": "Favoritos",
"Playlist": "Playlist",
"Filter": "Filtrar",
"Sort By": "Ordenar",
"Bump Order": "Bump",
"Creation Date": "Criação",
"Reply Count": "Respostas",
"No posts.": "No Posts.",
"Show Post Actions": "Denunciar/Moderar",
"Actions": "Ações",
"Submit": "Enviar",
"Max %s files": {
"one": "Máx %s",
"other": "Máx %s"

@ -1,8 +1,8 @@
details.toggle-label#actionform
summary.collapse#action-menu Show Post Actions
summary.collapse#action-menu #{__('Show Post Actions')}
.actions
input(type='hidden' name='hide_name' value='1')
h4.no-m-p Actions:
h4.no-m-p #{__('Actions')}:
if board.settings.userPostDelete
label
input.post-check(type='checkbox', name='delete' value='1')
@ -29,4 +29,4 @@ details.toggle-label#actionform
.actions
h4.no-m-p Captcha:
include ./captcha.pug
input(type='submit', value='Submit')
input(type='submit', value=__('Submit'))

@ -1,7 +1,7 @@
details.toggle-label#actionform
summary.collapse#action-menu Show Post Actions
summary.collapse#action-menu #{__('Show Post Actions')}
.actions
h4.no-m-p Actions:
h4.no-m-p #{__('Actions')}:
label
input.post-check(type='checkbox', name='delete' value='1')
| Delete Posts
@ -50,4 +50,4 @@ details.toggle-label#actionform
input(type='text', name='ban_duration', placeholder='Ban duration e.g. 7d' autocomplete='off')
label
input(type='text', name='log_message', placeholder='Modlog message' autocomplete='off')
input(type='submit', value='Submit')
input(type='submit', value=__('Submit'))

@ -1,7 +1,7 @@
details.toggle-label#actionform
summary.collapse#action-menu Show Post Actions
summary.collapse#action-menu #{__('Show Post Actions')}
.actions
h4.no-m-p Actions:
h4.no-m-p #{__('Actions')}:
.row.wrap
.col.mr-5
label
@ -87,4 +87,4 @@ details.toggle-label#actionform
label
input.post-check(type='checkbox', name='cyclic' value='1')
| Toggle Cycle
input(type='submit', value='Submit')
input(type='submit', value=__('Submit'))

@ -1,4 +1,4 @@
| Page:
| #{__('Page')}:
if maxPage === 0
a.bold(href=`index.html`) [1]
- for(let i = 1; i <= maxPage; i++)

@ -1,15 +1,15 @@
case captchaOptions.type
when 'google'
div(class='g-recaptcha' data-sitekey=`${googleRecaptchaSiteKey}` data-theme='dark' data-size='compact' data-callback='recaptchaCallback')
noscript Please enable JavaScript to solve the captcha.
noscript #{__('Please enable JavaScript to solve the captcha.')}
when 'hcaptcha'
div(class='h-captcha' data-sitekey=`${hcaptchaSiteKey}` data-theme='dark' data-size='compact' data-callback='recaptchaCallback')
noscript Please enable JavaScript to solve the captcha.
noscript #{__('Please enable JavaScript to solve the captcha.')}
when 'text'
noscript.no-m-p
iframe.captcha(src='/captcha.html' 'width=210' height='80' scrolling='no' loading='lazy')
.jsonly.captcha(style='display:none;')
input.captchafield(type='text' name='captcha' autocomplete='off' placeholder='Captcha text' pattern='.{6}' required title='6 characters')
input.captchafield(type='text' name='captcha' autocomplete='off' placeholder=__('Captcha text') pattern='.{6}' required title=__n('%s characters', 6))
when 'grid'
when 'grid2'
span.text-center #{captchaOptions.grid.question}

@ -1,4 +1,4 @@
| Page:
| #{__('Page')}:
- const qs = queryString ? queryString+'&' : ''
if maxPage === 0
a.bold(href=`?${qs}page=1`) [1]

@ -88,5 +88,5 @@ section.form-wrapper.flex-center
include ./captchasidelabel.pug
else
include ./captchaexpand.pug
input#submitpost(type='submit', value=`New ${isThread ? 'Reply' : 'Thread'}`)
input#submitpost(type='submit', value=(isThread ? __('New Reply') : __('New Thread')))
a.collapse.no-decoration.post-button(href='#postform') [#{isThread ? __('New Reply') : __('New Reply')}]

@ -39,19 +39,22 @@ mixin catalogtile(post, index, overboard=false)
a.no-decoration.post-subject(href=postURL) #{post.subject || `#${post.postId}`}
|
select.jsonly.postmenu
option(value='single') Hide
option(value='single') #{__('Hide')}
if post.subject
option(value='fsub') Filter Subject
option(value='fsub') #{__('Filter Subject')}
if (modview || manage || globalmanage)
option(value='edit') #{__('Edit')}
if !overboard
option(value='moderate') Moderate
option(value='watch') Watch
option(value='moderate') #{__('Moderate')}
option(value='watch') #{__('Watch')}
option(value='playlist') #{__('Playlist')}
br
span(title='Replies') R: #{post.replyposts}
span(title=__n('Replies', 2)) R: #{post.replyposts}
| /
span(title='Files') F: #{post.replyfiles + post.files.length}
span(title=__n('Files', 2)) F: #{post.replyfiles + post.files.length}
if !overboard
| /
span(title='Page') P: #{Math.ceil(index/10)}
span(title=__('Page')) P: #{Math.ceil(index/10)}
if post.files.length > 0
.col
.row.ct-r1

@ -67,22 +67,22 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false, overboar
|
span.noselect: a(href=`${postURL}`) [Open]
select.jsonly.postmenu
option(value='single') Hide
option(value='single') #{__('Hide')}
if post.userId
option(value='fid') Filter ID
option(value='fid') #{__('Filter ID')}
if post.name
option(value='fname') Filter Name
option(value='fname') #{__('Filter Name')}
if post.subject
option(value='fsub') Filter Subject
option(value='fsub') #{__('Filter Subject')}
if post.tripcode
option(value='ftrip') Filter Tripcode
option(value='ftrip') #{__('Filter Tripcode')}
if !overboard && !ban
option(value='moderate') Moderate
option(value='moderate') #{__('Moderate')}
if !ban && (modview || manage || globalmanage)
option(value='edit') Edit
option(value='edit') #{__('Edit')}
if !post.thread
option(value='watch') Watch
option(value='playlist') Playlist
option(value='watch') #{__('Watch')}
option(value='playlist') #{__('Playlist')}
.post-data
if post.files.length > 0
.post-files(class=(post.files.length > 1 ? 'fn' : ''))

@ -1,5 +1,5 @@
mixin threadwatcher(minimised)
.flex-center#threadwatcher(class=(minimised ? 'minimised' : ''))
.row.noselect#threadwatcher-dragHandle
span.fw.text-center Thread Watcher
span.fw.text-center #{__('Thread Watcher')}
span.mr-0.close #{minimised ? '[+]' : '[−]'}

@ -22,18 +22,18 @@ block content
.pages
+boardnav('catalog', true, false)
.pages.jsonly
input#catalogfilter(type='text' placeholder='Filter')
input#catalogfilter(type='text' placeholder=__('Filter'))
select.ml-5.right#catalogsort
option(value="" disabled selected hidden) Sort by
option(value="bump") Bump order
option(value="date") Creation date
option(value="replies") Reply count
option(value="" disabled selected hidden) #{__('Sort By')}
option(value="bump") #{__('Bump Order')}
option(value="date") #{__('Creation Date')}
option(value="replies") #{__('Reply Count')}
form(action=`/forms/board/${board._id}/${modview ? 'mod' : ''}actions` method='POST' enctype='application/x-www-form-urlencoded')
if modview
input(type='hidden' name='_csrf' value=csrf)
hr(size=1)
if threads.length === 0
p No posts.
p #{__('No posts')}
else
.catalog
for thread, i in threads

@ -20,12 +20,12 @@ block content
include ../includes/stickynav.pug
.wrapbar
.pages.jsonly
input#catalogfilter(type='text' placeholder='Filter')
input#catalogfilter(type='text' placeholder=__('Filter'))
select.ml-5.right#catalogsort
option(value="" disabled selected hidden) Sort by
option(value="bump") Bump order
option(value="date") Creation date
option(value="replies") Reply count
option(value="" disabled selected hidden) #{__('Sort By')}
option(value="bump") #{__('Bump Order')}
option(value="date") #{__('Creation Date')}
option(value="replies") #{__('Reply Count')}
hr(size=1)
if threads.length === 0
p No posts.

Loading…
Cancel
Save