i18n: time plurals

This commit is contained in:
ed 2024-10-03 07:38:33 +00:00
parent 19a5985f29
commit 001afe00cb
3 changed files with 40 additions and 21 deletions

View file

@ -94,10 +94,14 @@ var Ls = {
"danger": "DANGER",
"clipped": "copied to clipboard",
"ht_s": "second!s",
"ht_m": "minute!s",
"ht_h": "hour!s",
"ht_d": "day!s",
"ht_s1": "second",
"ht_s2": "seconds",
"ht_m1": "minute",
"ht_m2": "minutes",
"ht_h1": "hour",
"ht_h2": "hours",
"ht_d1": "day",
"ht_d2": "days",
"ht_and": " and ",
"goh": "control-panel",
@ -325,7 +329,7 @@ var Ls = {
"fs_sc": "share the folder you're in",
"fs_ss": "share the selected files",
"fs_just1d": "you cannot select more than one folder,\nor mix flies and folders in one selection",
"fs_just1d": "you cannot select more than one folder,\nor mix files and folders in one selection",
"fs_abrt": "❌ abort",
"fs_rand": "🎲 rand.name",
"fs_go": "✅ create share",
@ -658,10 +662,14 @@ var Ls = {
"danger": "VARSKU",
"clipped": "kopiert til utklippstavlen",
"ht_s": "sekund!er",
"ht_m": "minutt!er",
"ht_h": "time!r",
"ht_d": "dag!er",
"ht_s1": "sekund",
"ht_s2": "sekunder",
"ht_m1": "minutt",
"ht_m2": "minutter",
"ht_h1": "time",
"ht_h2": "timer",
"ht_d1": "dag",
"ht_d2": "dager",
"ht_and": " og ",
"goh": "kontrollpanel",
@ -1222,10 +1230,14 @@ var Ls = {
"danger": "危险",
"clipped": "已复制到剪贴板",
"ht_s": "秒",
"ht_m": "分",
"ht_h": "时",
"ht_d": "天",
"ht_s1": "秒",
"ht_s2": "秒",
"ht_m1": "分",
"ht_m2": "分",
"ht_h1": "时",
"ht_h2": "时",
"ht_d1": "天",
"ht_d2": "天",
"ht_and": " 和 ",
"goh": "控制面板",

View file

@ -922,15 +922,18 @@ function shumantime(v, long) {
function lhumantime(v) {
var t = shumantime(v, 1),
tp = t.replace(/([a-z])/g, " $1 ").split(/ /g).slice(0, -1);
var t = shumantime(v, 1);
if (/[0-9]$/.exec(t))
t += 's';
var tp = t.replace(/([a-z])/g, " $1 ").split(/ /g).slice(0, -1);
if (!L || tp.length < 2 || tp[1].indexOf('$') + 1)
return t;
var ret = '';
for (var a = 0; a < tp.length; a += 2)
ret += tp[a] + ' ' + L['ht_' + tp[a + 1]].replace(tp[a] == 1 ? /!.*/ : /!/, '') + L.ht_and;
ret += tp[a] + ' ' + L['ht_' + tp[a + 1] + (tp[a]==1?1:2)] + L.ht_and;
return ret.slice(0, -L.ht_and.length);
}

View file

@ -175,10 +175,14 @@ var tl_browser = {
"danger": "DANGER",
"clipped": "copied to clipboard",
"ht_s": "second!s",
"ht_m": "minute!s",
"ht_h": "hour!s",
"ht_d": "day!s",
"ht_s1": "second",
"ht_s2": "seconds",
"ht_m1": "minute",
"ht_m2": "minutes",
"ht_h1": "hour",
"ht_h2": "hours",
"ht_d1": "day",
"ht_d2": "days",
"ht_and": " and ",
"goh": "control-panel",
@ -406,7 +410,7 @@ var tl_browser = {
"fs_sc": "share the folder you're in",
"fs_ss": "share the selected files",
"fs_just1d": "you cannot select more than one folder,\nor mix flies and folders in one selection",
"fs_just1d": "you cannot select more than one folder,\nor mix files and folders in one selection",
"fs_abrt": "❌ abort",
"fs_rand": "🎲 rand.name",
"fs_go": "✅ create share",