mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 14:38:05 +02:00
Localize address placeholders
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user