diff --git a/src/components/TranslatedError.js b/src/components/TranslatedError.js index d5e8257c..cac520c0 100644 --- a/src/components/TranslatedError.js +++ b/src/components/TranslatedError.js @@ -30,14 +30,16 @@ class TranslatedError extends PureComponent { } return null } + // $FlowFixMe + const arg: Object = Object.assign({ message: error.message }, error) if (error.name) { - const translation = t(`errors:${error.name}.${field}`, error) + const translation = t(`errors:${error.name}.${field}`, arg) if (translation !== `${error.name}.${field}`) { // It is translated return translation } } - return t(`errors:generic.${field}`, error) + return t(`errors:generic.${field}`, arg) } }