]> git.openstreetmap.org Git - rails.git/commitdiff
Fix lego translation with locate control
authorTom Hughes <tom@compton.nu>
Fri, 20 Mar 2020 14:28:51 +0000 (14:28 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 20 Mar 2020 14:28:51 +0000 (14:28 +0000)
Fixes #2564

app/assets/javascripts/user.js
config/locales/en.yml

index 3839a18c24c10a5d16c776b934a16b5bd673d6e0..b9518f10de451cca7f76cccd20c257dad91f663c 100644 (file)
@@ -18,9 +18,9 @@ $(document).ready(function () {
       iconLoading: "icon geolocate",
       strings: {
         title: I18n.t("javascripts.map.locate.title"),
-        metersUnit: I18n.t("javascripts.map.locate.metersUnit"),
-        feetUnit: I18n.t("javascripts.map.locate.feetUnit"),
-        popup: I18n.t("javascripts.map.locate.popup")
+        popup: function (options) {
+          return I18n.t("javascripts.map.locate." + options.unit + "Popup", :count => options.distance);
+        }
       }
     }).addTo(map);
 
index 173fc158e69dfc268ce4fe5377d1b3f9c50b6568..2c31ba2d9f93703c269ad5b594bbc598c9004a4f 100644 (file)
@@ -2472,9 +2472,12 @@ en:
         out: Zoom Out
       locate:
         title: Show My Location
-        metersUnit: meters
-        feetUnit: feet
-        popup: You are within {distance} {unit} of this point
+        metersPopup:
+          one: You are within one meter of this point
+          other: You are within %{count} meters of this point
+        feetPopup:
+          one: You are within one foot of this point
+          other: You are within %{count} feet of this point
       base:
         standard: Standard
         cycle_map: Cycle Map