diff --git a/src/components/Form.js b/src/components/Form.js index 3f625425df4c..23c1c7c8237d 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -87,11 +87,13 @@ class Form extends React.Component { this.submit = this.submit.bind(this); } - /** - * @param {String} inputID - The inputID of the input being touched - */ - setTouchedInput(inputID) { - this.touchedInputs[inputID] = true; + componentDidUpdate(prevProps) { + if (prevProps.preferredLocale === this.props.preferredLocale) { + return; + } + + // Update the error messages if the language changes + this.validate(this.state.inputValues); } getErrorMessage() { @@ -110,6 +112,13 @@ class Form extends React.Component { return _.first(_.keys(hasStateErrors ? this.state.erorrs : this.props.formState.errorFields)); } + /** + * @param {String} inputID - The inputID of the input being touched + */ + setTouchedInput(inputID) { + this.touchedInputs[inputID] = true; + } + submit() { // Return early if the form is already submitting to avoid duplicate submission if (this.props.formState.isLoading) {