mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 13:27:22 +00:00
Fixed localization of relative time (#7256)
This commit is contained in:
parent
5fc0eaef1a
commit
b8777539d7
@ -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);
|
||||
}
|
||||
|
@ -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": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user