Fixed localization of relative time (#7256)

This commit is contained in:
Jaroslav Hanslík 2020-10-08 15:53:59 +02:00 committed by GitHub
parent 5fc0eaef1a
commit b8777539d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -38,13 +38,11 @@ export default function relativeTime(
roundedDelta = Math.round(delta);
}
const timeDesc = localize(
`ui.components.relative_time.duration.${unit}`,
return localize(
options.includeTense === false
? `ui.components.relative_time.duration.${unit}`
: `ui.components.relative_time.${tense}_duration.${unit}`,
"count",
roundedDelta
);
return options.includeTense === false
? timeDesc
: localize(`ui.components.relative_time.${tense}`, "time", timeDesc);
}

View File

@ -355,8 +355,6 @@
"select": "Select"
},
"relative_time": {
"past": "{time} ago",
"future": "In {time}",
"never": "Never",
"just_now": "Just now",
"duration": {
@ -365,6 +363,20 @@
"hour": "{count} {count, plural,\n one {hour}\n other {hours}\n}",
"day": "{count} {count, plural,\n one {day}\n other {days}\n}",
"week": "{count} {count, plural,\n one {week}\n other {weeks}\n}"
},
"past_duration": {
"second": "{count} {count, plural,\n one {second}\n other {seconds}\n} ago",
"minute": "{count} {count, plural,\n one {minute}\n other {minutes}\n} ago",
"hour": "{count} {count, plural,\n one {hour}\n other {hours}\n} ago",
"day": "{count} {count, plural,\n one {day}\n other {days}\n} ago",
"week": "{count} {count, plural,\n one {week}\n other {weeks}\n} ago"
},
"future_duration": {
"second": "In {count} {count, plural,\n one {second}\n other {seconds}\n}",
"minute": "In {count} {count, plural,\n one {minute}\n other {minutes}\n}",
"hour": "In {count} {count, plural,\n one {hour}\n other {hours}\n}",
"day": "In {count} {count, plural,\n one {day}\n other {days}\n}",
"week": "In {count} {count, plural,\n one {week}\n other {weeks}\n}"
}
},
"history_charts": {