mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 22:06:34 +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);
|
roundedDelta = Math.round(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
const timeDesc = localize(
|
return localize(
|
||||||
`ui.components.relative_time.duration.${unit}`,
|
options.includeTense === false
|
||||||
|
? `ui.components.relative_time.duration.${unit}`
|
||||||
|
: `ui.components.relative_time.${tense}_duration.${unit}`,
|
||||||
"count",
|
"count",
|
||||||
roundedDelta
|
roundedDelta
|
||||||
);
|
);
|
||||||
|
|
||||||
return options.includeTense === false
|
|
||||||
? timeDesc
|
|
||||||
: localize(`ui.components.relative_time.${tense}`, "time", timeDesc);
|
|
||||||
}
|
}
|
||||||
|
@ -355,8 +355,6 @@
|
|||||||
"select": "Select"
|
"select": "Select"
|
||||||
},
|
},
|
||||||
"relative_time": {
|
"relative_time": {
|
||||||
"past": "{time} ago",
|
|
||||||
"future": "In {time}",
|
|
||||||
"never": "Never",
|
"never": "Never",
|
||||||
"just_now": "Just now",
|
"just_now": "Just now",
|
||||||
"duration": {
|
"duration": {
|
||||||
@ -365,6 +363,20 @@
|
|||||||
"hour": "{count} {count, plural,\n one {hour}\n other {hours}\n}",
|
"hour": "{count} {count, plural,\n one {hour}\n other {hours}\n}",
|
||||||
"day": "{count} {count, plural,\n one {day}\n other {days}\n}",
|
"day": "{count} {count, plural,\n one {day}\n other {days}\n}",
|
||||||
"week": "{count} {count, plural,\n one {week}\n other {weeks}\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": {
|
"history_charts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user