diff --git a/source/components/conversation/FormDecorator.js b/source/components/conversation/FormDecorator.js index 2eb118b87..891db0710 100644 --- a/source/components/conversation/FormDecorator.js +++ b/source/components/conversation/FormDecorator.js @@ -1,5 +1,6 @@ import React, { Component } from 'react' import { Trans } from 'react-i18next' +import PropTypes from 'prop-types' import classNames from 'classnames' import { connect } from 'react-redux' import { Field, change, formValueSelector } from 'redux-form' @@ -32,6 +33,9 @@ export var FormDecorator = formType => RenderField => }) ) class extends Component { + static contextTypes = { + i18n: PropTypes.object.isRequired + } state = { helpVisible: false } @@ -69,7 +73,8 @@ export var FormDecorator = formType => RenderField => inversion, inverted, themeColours - } = this.props + } = this.props, + { i18n } = this.context /* Nos propriétés personnalisées à envoyer au RenderField. Elles sont regroupées dans un objet précis pour pouvoir être enlevées des @@ -89,7 +94,8 @@ export var FormDecorator = formType => RenderField => let wideQuestion = formType == 'rhetorical-question' && !possibleChoice let { pre = v => v, test, error } = valueType ? valueType.validator : {}, - validate = test && (v => (v && test(pre(v)) ? undefined : error)) + validate = test && (v => (v && test(pre(v)) ? undefined : error)), + inversionQ = path(['props', 'step', 'inversion', 'question'])(this) let question = (

RenderField => maxWidth: wideQuestion ? '95%' : '' }} > - {path(['props', 'step', 'inversion', 'question'])(this) || - this.props.step.question} + { + inversionQ ? + i18n.t(inversionQ) + : this.props.step.question + }

) return ( diff --git a/source/locales/en.yaml b/source/locales/en.yaml index 0da949f1d..576a10115 100644 --- a/source/locales/en.yaml +++ b/source/locales/en.yaml @@ -36,3 +36,4 @@ Salaire total: Total salary Salaire de base: Base salary disclaimer: This estimate takes into account national law but not union negotiated rules, and should not be used as a pay slip. If results differ from a pay slip, we refer you to an accountant or HR expert. clickForMore: You can click the results below for detailed explanations. +Quel est le salaire mensuel ?: What is the monthly salary? diff --git a/source/règles/base.yaml b/source/règles/base.yaml index 25d1a506b..80160c0f4 100644 --- a/source/règles/base.yaml +++ b/source/règles/base.yaml @@ -682,7 +682,7 @@ formule: inversion: - question: What is the monthly salary ? + question: Quel est le salaire mensuel ? titre: salaire avec: - salaire net