Improve localization of "Thank you for editing the map around.."

(closes #6269)
This commit is contained in:
Bryan Housel
2019-05-04 13:24:46 -04:00
parent 8b083b46d5
commit 8f9dc7afb4
3 changed files with 14 additions and 7 deletions
+3
View File
@@ -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"
+4
View File
@@ -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",
+7 -7
View File
@@ -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 }
);
});
}