Skip to content

Commit 770f058

Browse files
authored
fix interval translations for the limit reductions tables (#861)
1 parent 6034fdb commit 770f058

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/components/parameters/common/limitreductions/limit-reductions-tooltip-column.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
77

8-
import { FormattedMessage } from 'react-intl';
8+
import { FormattedMessage, useIntl } from 'react-intl';
99
import { ITemporaryLimitReduction } from './columns-definitions';
1010

1111
type LimitReductionsLabelColumnProps = {
1212
limits: ITemporaryLimitReduction;
1313
};
1414

1515
export function LimitReductionsToolTipColumn({ limits }: Readonly<LimitReductionsLabelColumnProps>) {
16+
const intl = useIntl();
1617
const lowBound = `${Math.trunc(limits.limitDuration.lowBound / 60)} min`;
1718
const highBoundValue = Math.trunc(limits.limitDuration.highBound / 60);
1819
const highBound = highBoundValue === 0 ? '∞' : `${Math.trunc(limits.limitDuration.highBound / 60)} min`;
19-
const lowerBoundClosed = limits.limitDuration.lowClosed ? '[' : ']';
20-
const higherBoundClosed = limits.limitDuration.highClosed || null ? ']' : '[';
20+
const lowerBoundClosed = limits.limitDuration.lowClosed ? '[' : intl.formatMessage({ id: 'leftOpenBracket' });
21+
const higherBoundClosed =
22+
limits.limitDuration.highClosed || null ? ']' : intl.formatMessage({ id: 'rightOpenBracket' });
2123
return (
2224
<FormattedMessage
2325
id="LimitDurationInterval"

src/translations/en/parameters.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ export const parametersEn = {
6161
LimitVoltageAfterIST: 'Between PATL and TATL{highBound}',
6262
LimitDurationInterval: 'Duration {lowerBoundClosed}{lowBound}, {highBound}{higherBoundClosed}',
6363
voltageRange: 'Voltage range',
64-
VoltageRangeInterval: 'Voltage interval ]{lowBound} kV,{highBound} kV]',
64+
VoltageRangeInterval: 'Voltage interval ({lowBound} kV, {highBound} kV]',
65+
leftOpenBracket: '(',
66+
rightOpenBracket: ')',
6567

6668
Provider: 'Provider',
6769
LimitReduction: 'Limit reduction',

src/translations/fr/parameters.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ export const parametersFr = {
6161
IST: 'IST',
6262
LimitVoltageInterval: 'Entre IT{lowBound} et IT{highBound}',
6363
LimitVoltageAfterIST: 'Entre IST et IT{highBound}',
64-
LimitDurationInterval: 'Tempo {lowerBoundClosed}{lowBound}, {highBound}{higherBoundClosed}',
64+
LimitDurationInterval: 'Tempo {lowerBoundClosed}{lowBound}; {highBound}{higherBoundClosed}',
6565
voltageRange: 'Niveau de tension',
66-
VoltageRangeInterval: 'Plage de tension ]{lowBound} kV,{highBound} kV]',
66+
VoltageRangeInterval: 'Plage de tension ]{lowBound} kV; {highBound} kV]',
67+
leftOpenBracket: ']',
68+
rightOpenBracket: '[',
6769

6870
Provider: 'Simulateur',
6971
LimitReduction: 'Abattement des seuils',

0 commit comments

Comments
 (0)