diff --git a/data/core.yaml b/data/core.yaml index 4f44679f9..099874d61 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -718,6 +718,9 @@ en: just_edited: "You just edited OpenStreetMap!" thank_you: "Thank you for improving the map." thank_you_location: "Thank you for improving the map around {where}." + thank_you_where: + format: "{place}{separator}{region}" + separator: ", " help_html: Your changes should appear on OpenStreetMap within a few minutes. It may take longer for maps elsewhere to receive updates. help_link_text: Details help_link_url: "https://wiki.openstreetmap.org/wiki/FAQ#I_have_just_made_some_changes_to_the_map._How_do_I_get_to_see_my_changes.3F" diff --git a/dist/locales/en.json b/dist/locales/en.json index bfc34c73c..f6426ccc3 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -892,6 +892,10 @@ "just_edited": "You just edited OpenStreetMap!", "thank_you": "Thank you for improving the map.", "thank_you_location": "Thank you for improving the map around {where}.", + "thank_you_where": { + "format": "{place}{separator}{region}", + "separator": ", " + }, "help_html": "Your changes should appear on OpenStreetMap within a few minutes. It may take longer for maps elsewhere to receive updates.", "help_link_text": "Details", "help_link_url": "https://wiki.openstreetmap.org/wiki/FAQ#I_have_just_made_some_changes_to_the_map._How_do_I_get_to_see_my_changes.3F", diff --git a/modules/modes/save.js b/modules/modes/save.js index 9369fade1..c59aee045 100644 --- a/modules/modes/save.js +++ b/modules/modes/save.js @@ -471,7 +471,7 @@ export function modeSave(context) { // Reverse geocode current map location so we can display a message on - // the success screen like "Thank you for editing around city, state." + // the success screen like "Thank you for editing around place, region." function loadLocation() { _location = null; if (!services.geocoder) return; @@ -479,14 +479,14 @@ export function modeSave(context) { services.geocoder.reverse(context.map().center(), function(err, result) { if (err || !result || !result.address) return; - var parts = []; var addr = result.address; - var city = addr && (addr.town || addr.city || addr.county); - if (city) parts.push(city); - var region = addr && (addr.state || addr.country); - if (region) parts.push(region); + var place = (addr && (addr.town || addr.city || addr.county)) || ''; + var region = (addr && (addr.state || addr.country)) || ''; + var separator = (place && region) ? t('success.thank_you_where.separator') : ''; - _location = parts.join(', '); + _location = t('success.thank_you_where.format', + { place: place, separator: separator, region: region } + ); }); }