Don’t localize an empty string

This commit is contained in:
Matthew Taylor 2017-02-23 09:52:33 -05:00
parent df88daea36
commit f59774bd0d
2 changed files with 8 additions and 4 deletions

View file

@ -516,11 +516,10 @@ module.exports = {
'orgChoiceAfterschool', 'orgChoiceAfterschool',
'orgChoiceMuseum', 'orgChoiceMuseum',
'orgChoiceLibrary', 'orgChoiceLibrary',
'orgChoiceCamp', 'orgChoiceCamp'
'orgChoiceOther'
], ],
getOrganizationOptions: function () { getOrganizationOptions: function () {
return this.organizationL10nStems.map(function (choice, id) { var options = this.organizationL10nStems.map(function (choice, id) {
return { return {
value: id, value: id,
label: this.props.intl.formatMessage({ label: this.props.intl.formatMessage({
@ -528,6 +527,12 @@ module.exports = {
}) })
}; };
}.bind(this)); }.bind(this));
// Add "Other" option with empty string, since input field is used
var otherId = options.length;
options.push({value: otherId, label: ' '});
return options;
}, },
onChooseOrganization: function (name, values) { onChooseOrganization: function (name, values) {
this.setState({otherDisabled: values.indexOf(this.organizationL10nStems.indexOf('orgChoiceOther')) === -1}); this.setState({otherDisabled: values.indexOf(this.organizationL10nStems.indexOf('orgChoiceOther')) === -1});

View file

@ -21,7 +21,6 @@
"teacherRegistration.orgChoiceMuseum": "Museum", "teacherRegistration.orgChoiceMuseum": "Museum",
"teacherRegistration.orgChoiceLibrary": "Library", "teacherRegistration.orgChoiceLibrary": "Library",
"teacherRegistration.orgChoiceCamp": "Camp", "teacherRegistration.orgChoiceCamp": "Camp",
"teacherRegistration.orgChoiceOther": " ",
"teacherRegistration.notRequired": "Not Required", "teacherRegistration.notRequired": "Not Required",
"teacherRegistration.addressValidationError": "This doesn't look like a real address", "teacherRegistration.addressValidationError": "This doesn't look like a real address",
"teacherRegistration.addressLine1": "Address Line 1", "teacherRegistration.addressLine1": "Address Line 1",