diff --git a/source/engine/mecanismViews/Composantes.js b/source/engine/mecanismViews/Composantes.js index ded5559c0..4bbafe2b5 100644 --- a/source/engine/mecanismViews/Composantes.js +++ b/source/engine/mecanismViews/Composantes.js @@ -4,16 +4,19 @@ import { makeJsx } from '../evaluation' import './Composantes.css' import { Trans } from 'react-i18next' import { toPairs } from 'ramda' +import writtenNumbers from '../../locales/writtenNumbers.yaml' +import withLanguage from 'Components/utils/withLanguage' export default function Variations(nodeValue, explanation) { - return ( + let Comp = withLanguage(({ language }) => (

- Cette règle est la somme de deux{' '} + Cette règle est la somme de{' '} + {writtenNumbers[language][explanation.length]}{' '} :

    @@ -38,5 +41,6 @@ export default function Variations(nodeValue, explanation) { } /> - ) + )) + return } diff --git a/source/locales/writtenNumbers.yaml b/source/locales/writtenNumbers.yaml new file mode 100644 index 000000000..53e9a2231 --- /dev/null +++ b/source/locales/writtenNumbers.yaml @@ -0,0 +1,26 @@ +en: + - zero + - one + - two + - three + - four + - five + - six + - seven + - eight + - nine + - ten + +fr: + - zéro + - un + - deux + - trois + - quatre + - cinq + - six + - sept + - huit + - neuf + - dix +