diff --git a/site/source/components/Simulation/SimulationGoal.tsx b/site/source/components/Simulation/SimulationGoal.tsx index 071924688..b25b408d5 100644 --- a/site/source/components/Simulation/SimulationGoal.tsx +++ b/site/source/components/Simulation/SimulationGoal.tsx @@ -1,6 +1,7 @@ import { DottedName } from 'modele-social' import { formatValue, PublicodesExpression } from 'publicodes' import React, { useCallback, useState } from 'react' +import { useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' import { styled } from 'styled-components' @@ -51,6 +52,7 @@ export function SimulationGoal({ const dispatch = useDispatch() const engine = useEngine() const currentUnit = useSelector(targetUnitSelector) + const language = useTranslation().i18n.language const evaluation = engine.evaluate({ valeur: dottedName, arrondi: round ? 'oui' : 'non', @@ -171,6 +173,7 @@ export function SimulationGoal({ {formatValue(evaluation, { displayedUnit, precision: round ? 0 : 2, + language, })} diff --git a/site/source/components/Simulation/SimulationValue.tsx b/site/source/components/Simulation/SimulationValue.tsx index ce54a1872..643e5b016 100644 --- a/site/source/components/Simulation/SimulationValue.tsx +++ b/site/source/components/Simulation/SimulationValue.tsx @@ -1,6 +1,7 @@ import { DottedName } from 'modele-social' import { formatValue } from 'publicodes' import React from 'react' +import { useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' import { styled } from 'styled-components' @@ -38,6 +39,7 @@ export function SimulationValue({ }: SimulationValueProps) { const engine = useEngine() const currentUnit = useSelector(targetUnitSelector) + const language = useTranslation().i18n.language const evaluation = engine.evaluate({ valeur: dottedName, arrondi: round ? 'oui' : 'non', @@ -87,6 +89,7 @@ export function SimulationValue({ {formatValue(evaluation, { displayedUnit, precision: round ? 0 : 2, + language, })}