mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 20:37:39 -02:30
Merge pull request #8008 from mabashian/8002-plurals
Use low level i18n._ instead of i18n.plural for plurals on the schedule form Reviewed-by: Jake McDermott <yo@jakemcdermott.me> https://github.com/jakemcdermott
This commit is contained in:
@@ -181,42 +181,32 @@ const FrequencyDetailSubform = ({ i18n }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getRunEveryLabel = () => {
|
const getRunEveryLabel = () => {
|
||||||
|
const intervalValue = interval.value;
|
||||||
|
|
||||||
switch (frequency.value) {
|
switch (frequency.value) {
|
||||||
case 'minute':
|
case 'minute':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {minute} other {minutes}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'minute',
|
|
||||||
other: 'minutes',
|
|
||||||
});
|
});
|
||||||
case 'hour':
|
case 'hour':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {hour} other {hours}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'hour',
|
|
||||||
other: 'hours',
|
|
||||||
});
|
});
|
||||||
case 'day':
|
case 'day':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {day} other {days}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'day',
|
|
||||||
other: 'days',
|
|
||||||
});
|
});
|
||||||
case 'week':
|
case 'week':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {week} other {weeks}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'week',
|
|
||||||
other: 'weeks',
|
|
||||||
});
|
});
|
||||||
case 'month':
|
case 'month':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {month} other {months}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'month',
|
|
||||||
other: 'months',
|
|
||||||
});
|
});
|
||||||
case 'year':
|
case 'year':
|
||||||
return i18n.plural({
|
return i18n._('{intervalValue, plural, one {year} other {years}}', {
|
||||||
value: interval.value,
|
intervalValue,
|
||||||
one: 'year',
|
|
||||||
other: 'years',
|
|
||||||
});
|
});
|
||||||
default:
|
default:
|
||||||
throw new Error(i18n._(t`Frequency did not match an expected value`));
|
throw new Error(i18n._(t`Frequency did not match an expected value`));
|
||||||
|
|||||||
Reference in New Issue
Block a user