mirror of https://gitgud.io/fatchan/jschan.git
indiachan-spamvector
parent
5db3bedb4d
commit
2d48f4110b
7 changed files with 52 additions and 17 deletions
@ -1,6 +1,18 @@ |
|||||||
/* eslint-disable no-unused-vars */ |
/* eslint-disable no-unused-vars */ |
||||||
/* globals LANG */ |
/* globals LANG */ |
||||||
|
|
||||||
|
const pluralMap = { |
||||||
|
1: 'one', |
||||||
|
// two, three, few, many, ...
|
||||||
|
}; |
||||||
|
|
||||||
|
//simple translation
|
||||||
const __ = (key) => { |
const __ = (key) => { |
||||||
//TODO: we'll see if this needs to be more advanced in future
|
|
||||||
return LANG[key]; |
return LANG[key]; |
||||||
}; |
}; |
||||||
|
|
||||||
|
//plurals+replace %s with count
|
||||||
|
const __n = (key, count) => { |
||||||
|
const pluralKey = pluralMap[count] || 'other'; |
||||||
|
return LANG[key][pluralKey].replace('%s', count); |
||||||
|
}; |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
mixin filelabel(id, max) |
mixin filelabel(id, max) |
||||||
label.jsonly.postform-style.filelabel(for=id) |
label.jsonly.postform-style.filelabel(for=id) |
||||||
| #{__(`Select/Drop/Paste file${max > 1 ? 's' : ''}`)} |
| #{__n(`Select/Drop/Paste files`, max)} |
||||||
|
Loading…
Reference in new issue