feat: ajoute la langue dans la mise en forme de SimulationValue et SimulationGoal
parent
e29101859e
commit
076b9daf40
|
@ -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,
|
||||
})}
|
||||
</Body>
|
||||
</Grid>
|
||||
|
|
|
@ -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,
|
||||
})}
|
||||
</StyledBody>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in New Issue