From 6be9fc10840e557ec5101d0530620734710a0019 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 6 Dec 2016 11:36:24 -0500 Subject: [PATCH 1/2] =?UTF-8?q?Localize=20default=20=E2=80=9Crequired?= =?UTF-8?q?=E2=80=9D=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #966. I was trying, if possible, to not introduce localization at the component level in order to keep it in the views – but that seemed a bit too involved given that the fix in this way is only a few lines long. --- src/components/forms/validations.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/forms/validations.jsx b/src/components/forms/validations.jsx index bd5099e05..14a935bca 100644 --- a/src/components/forms/validations.jsx +++ b/src/components/forms/validations.jsx @@ -1,4 +1,5 @@ var defaults = require('lodash.defaultsdeep'); +var intl = require('../../lib/intl.jsx'); var libphonenumber = require('google-libphonenumber'); var phoneNumberUtil = libphonenumber.PhoneNumberUtil.getInstance(); var React = require('react'); @@ -44,5 +45,5 @@ module.exports.validationHOCFactory = function (defaultValidationErrors) { }; module.exports.defaultValidationHOC = module.exports.validationHOCFactory({ - isDefaultRequiredValue: 'This field is required' + isDefaultRequiredValue: }); From 9ae4e5a96388a847732dc9128a1705d7bd246a6f Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Tue, 6 Dec 2016 15:13:38 -0500 Subject: [PATCH 2/2] Move `validationRequired` into general thanks @rschamp! --- src/components/forms/validations.jsx | 2 +- src/l10n.json | 2 ++ src/views/teacherregistration/l10n.json | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/forms/validations.jsx b/src/components/forms/validations.jsx index 14a935bca..113cd6fb4 100644 --- a/src/components/forms/validations.jsx +++ b/src/components/forms/validations.jsx @@ -45,5 +45,5 @@ module.exports.validationHOCFactory = function (defaultValidationErrors) { }; module.exports.defaultValidationHOC = module.exports.validationHOCFactory({ - isDefaultRequiredValue: + isDefaultRequiredValue: }); diff --git a/src/l10n.json b/src/l10n.json index 2ea184c23..c0e71af31 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -93,6 +93,8 @@ "footer.help": "Help Page", "footer.scratchFamily": "Scratch Family", + "form.validationRequired": "This field is required", + "login.forgotPassword": "Forgot Password?", "navigation.signOut": "Sign out", diff --git a/src/views/teacherregistration/l10n.json b/src/views/teacherregistration/l10n.json index 0d5f9680b..453eba315 100644 --- a/src/views/teacherregistration/l10n.json +++ b/src/views/teacherregistration/l10n.json @@ -39,6 +39,5 @@ "teacherRegistration.howUseScratch": "How do you plan to use Scratch at your organization?", "teacherRegistration.emailStepTitle": "Email Address", "teacherRegistration.emailStepDescription": "We will send you a confirmation email that will allow you to access your Scratch Teacher Account.", - "teacherRegistration.validationEmailMatch": "The emails do not match", - "teacherRegistration.validationRequired": "This field is required" + "teacherRegistration.validationEmailMatch": "The emails do not match" }