👽 Question d'inversion

pull/188/head
Laurent Bossavit 2018-03-27 22:01:06 +02:00 committed by Mael
parent 2601545168
commit 60951894f4
3 changed files with 15 additions and 5 deletions

View File

@ -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 = (
<h1
@ -100,8 +106,11 @@ export var FormDecorator = formType => RenderField =>
maxWidth: wideQuestion ? '95%' : ''
}}
>
{path(['props', 'step', 'inversion', 'question'])(this) ||
this.props.step.question}
{
inversionQ ?
i18n.t(inversionQ)
: this.props.step.question
}
</h1>
)
return (

View File

@ -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?

View File

@ -682,7 +682,7 @@
formule:
inversion:
question: What is the monthly salary ?
question: Quel est le salaire mensuel ?
titre: salaire
avec:
- salaire net