Localize address placeholders

This commit is contained in:
John Firebaugh
2013-03-11 20:15:28 -07:00
parent a5885ce3c2
commit 42be94c97f
3 changed files with 16 additions and 6 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
iD.presets.Form = function(form, id) {
form = _.clone(form);
form.t = function(scope, options) {
return t('presets.forms.' + id + '.' + scope, options);
};
form.label = function() {
return t('presets.forms.' + id + '.label', {default: form.key});
return form.t('label', {default: form.key});
};
return form;
+4 -4
View File
@@ -43,7 +43,7 @@ iD.ui.preset.address = function(form, context) {
housename = selection.append('input')
.property('type', 'text')
.attr('placeholder', 'Housename')
.attr('placeholder', form.t('placeholders.housename'))
.attr('class', 'addr-housename')
.on('blur', change)
.on('change', change)
@@ -51,7 +51,7 @@ iD.ui.preset.address = function(form, context) {
housenumber = selection.append('input')
.property('type', 'text')
.attr('placeholder', '123')
.attr('placeholder', form.t('placeholders.number'))
.attr('class', 'addr-number')
.on('blur', change)
.on('change', change)
@@ -62,14 +62,14 @@ iD.ui.preset.address = function(form, context) {
street = streetwrap.append('input')
.property('type', 'text')
.attr('placeholder', 'Street')
.attr('placeholder', form.t('placeholders.street'))
.attr('class', 'addr-street')
.on('blur', change)
.on('change', change);
city = selection.append('input')
.property('type', 'text')
.attr('placeholder', 'City')
.attr('placeholder', form.t('placeholders.city'))
.attr('class', 'addr-city')
.on('blur', change)
.on('change', change)
+7 -1
View File
@@ -248,7 +248,13 @@ locale.en = {
"label": "Access"
},
"address": {
"label": "Address"
"label": "Address",
"placeholders": {
"housename": "Housename",
"number": "123",
"street": "Street",
"city": "City"
}
},
"atm": {
"label": "ATM"