Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Limit Reductions Table Form to display duration bounds in minutes and adjust translations accordingly #2451

Merged
merged 17 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ const LimitReductionsTableForm: FunctionComponent<{

const getLabelColumn = useCallback(
(limit: ITemporaryLimitReduction) => {
const lowBound = Math.trunc(limit.limitDuration.lowBound / 60);
SlimaneAmar marked this conversation as resolved.
Show resolved Hide resolved
const highBound = Math.trunc(limit.limitDuration.highBound / 60);
if (lowBound === 0) {
return intl.formatMessage({ id: 'LimitDurationAfterIST' }, { value: highBound });
}
const lowBoundLabel = lowBound === 0 ? 'IST' : 'IT ' + lowBound;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?
IST it's for permanent limit

const highBoundLabel = highBound === 0 ? 'IST' : 'IT ' + highBound;
return intl.formatMessage(
{ id: 'LimitDuration' },
{
sign: limit.limitDuration.lowClosed ? '>=' : '>',
value: Math.trunc(limit.limitDuration.lowBound / 60),
lowBound: lowBoundLabel,
highBound: highBoundLabel,
}
);
},
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

"LimitReductions" : "Limit reductions",
jamal-khey marked this conversation as resolved.
Show resolved Hide resolved
"IST" : "IST",
"LimitDuration" : "Limit duration {sign} {value}min",
"LimitDuration" : "Between {highBound} and {lowBound}",
SlimaneAmar marked this conversation as resolved.
Show resolved Hide resolved
"LimitDurationAfterIST": "After IT{value}",

"button.delete": "Delete",
"filter": "Filter",
Expand Down
3 changes: 2 additions & 1 deletion src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

"LimitReductions" : "Abattements de limites",
"IST" : "IST",
"LimitDuration" : "Surcharge {sign} {value}min",
"LimitDuration" : "Entre {highBound} et {lowBound}",
"LimitDurationAfterIST": "Audelà de IT{value}",
SlimaneAmar marked this conversation as resolved.
Show resolved Hide resolved

"button.delete": "Supprimer",
"filter": "Filtre",
Expand Down
Loading