UX: relative-time-picker should use pluralized strings (#12086)

This commit is contained in:
Gerhard Schlager 2021-02-15 14:15:22 +01:00 committed by GitHub
parent 467b075ef7
commit f71ff2c34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 10 deletions

View File

@ -36,13 +36,27 @@ export default Component.extend({
}
},
@discourseComputed
intervals() {
@discourseComputed("duration")
intervals(duration) {
const count = duration ? parseFloat(duration) : 0;
return [
{ id: "mins", name: I18n.t("relative_time_picker.minutes") },
{ id: "hours", name: I18n.t("relative_time_picker.hours") },
{ id: "days", name: I18n.t("relative_time_picker.days") },
{ id: "months", name: I18n.t("relative_time_picker.months") },
{
id: "mins",
name: I18n.t("relative_time_picker.minutes", { count }),
},
{
id: "hours",
name: I18n.t("relative_time_picker.hours", { count }),
},
{
id: "days",
name: I18n.t("relative_time_picker.days", { count }),
},
{
id: "months",
name: I18n.t("relative_time_picker.months", { count }),
},
];
},

View File

@ -576,10 +576,18 @@ en:
send_email: "Send rejection email"
relative_time_picker:
minutes: "minute(s)"
hours: "hour(s)"
days: "day(s)"
months: "month(s)"
minutes:
one: "minute"
other: "minutes"
hours:
one: "hour"
other: "hours"
days:
one: "day"
other: "days"
months:
one: "month"
other: "months"
time_shortcut:
later_today: "Later today"