diff --git a/js/i18n.js b/js/i18n.js
index 176c8e5..3053767 100644
--- a/js/i18n.js
+++ b/js/i18n.js
@@ -19,7 +19,7 @@ const rerender = () => {
// may have to fix this??
reloadLists(i18next.resolvedLanguage);
- // these translations won't get re-copied to their current controls
+ // these translations won't get re-copied to their current controls
successString = i18n.t('messages.success', {
escapeInterpolation: false
});
@@ -31,6 +31,29 @@ const rerender = () => {
modalText.text = i18n.t('messages.modalTitle');
modalText.button = i18n.t('messages.modalButton');
+ // Move the address fields around to match the localization
+ let parent = $('#hnumbergroup').parent();
+ let hnumber = $('#hnumbergroup').clone();
+ let street = $('#streetgroup').clone();
+ let placename = $('#placenamegroup').clone();
+ let city = $('#citygroup').clone();
+ let postcode = $('#postcodegroup').clone();
+ parent.empty()
+ if (i18next.resolvedLanguage === 'en-US') {
+ // US English should show house number before street name and hide place name
+ parent.append(hnumber);
+ parent.append(street);
+ parent.append(city);
+ parent.append(postcode);
+ } else {
+ // All other languages should show street before house number
+ parent.append(street);
+ parent.append(placename);
+ parent.append(hnumber);
+ parent.append(city);
+ parent.append(postcode);
+ }
+
$('body').localize();
};
@@ -74,5 +97,5 @@ $(function () {
rerender();
if (err) return console.error(err);
- });
-});
+ });
+});
diff --git a/js/site.js b/js/site.js
index 415d14a..b2c3558 100755
--- a/js/site.js
+++ b/js/site.js
@@ -591,6 +591,7 @@ function getNoteBody() {
if ($("#name").val()) note_body += i18n.t('step2.name') + ": " + $("#name").val() + "\n";
if ($("#hnumberalt").val()) note_body += "addr:housenumber=" + $("#hnumberalt").val() + "\n";
if ($("#addressalt").val()) note_body += "addr:street=" + $("#addressalt").val() + "\n";
+ if ($("#placenamealt").val()) note_body += "addr:place=" + $("#placenamealt").val() + "\n";
if ($("#city").val()) note_body += "addr:city=" + $("#city").val() + "\n";
if ($("#postcode").val()) note_body += "addr:postcode=" + $("#postcode").val() + "\n";
if ($("#phone").val()) note_body += i18n.t('step2.phone') + ": " + $("#phone").val() + "\n";
diff --git a/locales/en-GB/translation.json b/locales/en-GB/translation.json
index 52993a4..a9752e7 100755
--- a/locales/en-GB/translation.json
+++ b/locales/en-GB/translation.json
@@ -23,10 +23,12 @@
"cataltdesc": "Description",
"addressalt": "Help us by filling the complete address (housenumber, post code) or improving the previous one",
"street": "Street",
- "housenumber": "Housenumber",
+ "placename": "Place Name",
+ "housenumber": "House Number",
"city": "City",
"postcode": "Postcode",
"addressaltplaceholder": "West Main Street",
+ "placenameplaceholder": "Woods Village",
"housenumberplaceholder": "501",
"cityplaceholder": "Alexandria",
"postcodeplaceholder": "50023",
diff --git a/locales/en-US/translation.json b/locales/en-US/translation.json
index 0cd427b..1dcb07c 100644
--- a/locales/en-US/translation.json
+++ b/locales/en-US/translation.json
@@ -23,10 +23,12 @@
"cataltdesc": "Description",
"addressalt": "Help us by filling the complete address (housenumber, post code) or improving the previous one",
"street": "Street",
+ "placename": "Place Name",
"housenumber": "Housenumber",
"city": "City",
"postcode": "Zipcode",
"addressaltplaceholder": "West Main Street",
+ "placenameplaceholder": "Woods Village",
"housenumberplaceholder": "501",
"cityplaceholder": "Alexandria",
"postcodeplaceholder": "50023",
diff --git a/locales/en/translation.json b/locales/en/translation.json
index 7b1ca22..a51ef44 100644
--- a/locales/en/translation.json
+++ b/locales/en/translation.json
@@ -24,10 +24,12 @@
"cataltdesc": "Description",
"addressalt": "Help us by filling the complete address (housenumber, post code) or improving the previous one",
"street": "Street",
- "housenumber": "Housenumber",
+ "placename": "Place Name",
+ "housenumber": "House Number",
"city": "City",
"postcode": "Postcode",
"addressaltplaceholder": "West Main Street",
+ "placenameplaceholder": "Woods Village",
"housenumberplaceholder": "501",
"cityplaceholder": "Alexandria",
"postcodeplaceholder": "50023",
diff --git a/locales/es/translation.json b/locales/es/translation.json
index 29eefd6..22546f4 100644
--- a/locales/es/translation.json
+++ b/locales/es/translation.json
@@ -22,10 +22,12 @@
"cataltdesc": "Descripción",
"addressalt": "Ayúdenos rellenando la dirección completa (número de casa, código postal) o mejorando la anterior",
"street": "Calle",
+ "placename": "Nombre del lugar",
"housenumber": "Número de casa",
"city": "Ciudad",
"postcode": "Código postal",
"addressaltplaceholder": "Avenida América, España",
+ "placenameplaceholder": "Pueblo del Bosque",
"housenumberplaceholder": "501",
"cityplaceholder": "Alexandria",
"postcodeplaceholder": "50023",