]> git.openstreetmap.org Git - rails.git/commitdiff
Replace use of I18n in javascript with OSM.i18n
authorTom Hughes <tom@compton.nu>
Sun, 16 Mar 2025 16:16:22 +0000 (16:16 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 17 Mar 2025 17:19:15 +0000 (17:19 +0000)
25 files changed:
app/assets/javascripts/application.js
app/assets/javascripts/diary_entry.js
app/assets/javascripts/edit/id.js.erb
app/assets/javascripts/embed.js.erb
app/assets/javascripts/heatmap.js
app/assets/javascripts/index.js
app/assets/javascripts/index/contextmenu.js
app/assets/javascripts/index/directions-endpoint.js
app/assets/javascripts/index/directions.js
app/assets/javascripts/index/directions/fossgis_osrm.js
app/assets/javascripts/index/directions/fossgis_valhalla.js
app/assets/javascripts/index/directions/graphhopper.js
app/assets/javascripts/index/home.js
app/assets/javascripts/index/layers/data.js
app/assets/javascripts/index/query.js
app/assets/javascripts/leaflet.key.js
app/assets/javascripts/leaflet.layers.js
app/assets/javascripts/leaflet.locate.js
app/assets/javascripts/leaflet.map.js
app/assets/javascripts/leaflet.note.js
app/assets/javascripts/leaflet.query.js
app/assets/javascripts/leaflet.share.js
app/assets/javascripts/leaflet.sidebar-pane.js
app/assets/javascripts/leaflet.zoom.js
app/assets/javascripts/user.js

index c01a0f14baf26dbc030b5b78dcab446e418af162..5c61b01ccfa6687587df15883533734f62530859 100644 (file)
 
   OSM.i18n = I18n;
 
 
   OSM.i18n = I18n;
 
-  I18n.default_locale = OSM.DEFAULT_LOCALE;
-  I18n.locale = locale;
+  OSM.i18n.default_locale = OSM.DEFAULT_LOCALE;
+  OSM.i18n.locale = locale;
 
   // '-' are replaced with '_' in https://github.com/eemeli/make-plural/tree/main/packages/plurals
   const pluralizer = plurals[locale.replace(/\W+/g, "_")] || plurals[locale.split("-")[0]];
   if (pluralizer) {
 
   // '-' are replaced with '_' in https://github.com/eemeli/make-plural/tree/main/packages/plurals
   const pluralizer = plurals[locale.replace(/\W+/g, "_")] || plurals[locale.split("-")[0]];
   if (pluralizer) {
-    I18n.pluralization[locale] = (count) => [pluralizer(count), "other"];
+    OSM.i18n.pluralization[locale] = (count) => [pluralizer(count), "other"];
   }
 
   OSM.preferred_editor = application_data.preferredEditor;
   }
 
   OSM.preferred_editor = application_data.preferredEditor;
@@ -199,5 +199,5 @@ $(function () {
   });
 
   $("#edit_tab")
   });
 
   $("#edit_tab")
-    .attr("title", I18n.t("javascripts.site.edit_disabled_tooltip"));
+    .attr("title", OSM.i18n.t("javascripts.site.edit_disabled_tooltip"));
 });
 });
index a87eb35f18664ad1ac61248024c7fa57937109da..bfc3fc0128a70470324f68117f7789d1316d8584 100644 (file)
@@ -12,7 +12,7 @@ $(function () {
     }
 
     marker = L.marker(e.latlng, { icon: OSM.getUserIcon() }).addTo(map)
     }
 
     marker = L.marker(e.latlng, { icon: OSM.getUserIcon() }).addTo(map)
-      .bindPopup(I18n.t("diary_entries.edit.marker_text"));
+      .bindPopup(OSM.i18n.t("diary_entries.edit.marker_text"));
   }
 
   $("#usemap").click(function (e) {
   }
 
   $("#usemap").click(function (e) {
@@ -37,7 +37,7 @@ $(function () {
 
     if ($("#latitude").val() && $("#longitude").val()) {
       marker = L.marker(centre, { icon: OSM.getUserIcon() }).addTo(map)
 
     if ($("#latitude").val() && $("#longitude").val()) {
       marker = L.marker(centre, { icon: OSM.getUserIcon() }).addTo(map)
-        .bindPopup(I18n.t("diary_entries.edit.marker_text"));
+        .bindPopup(OSM.i18n.t("diary_entries.edit.marker_text"));
     }
 
     map.on("click", setLocation);
     }
 
     map.on("click", setLocation);
index b85dbeddbbb4d0d39b4d5f63f3f7b52386548625..7f111b41ec4bfcad8bf24a3385874b3b265fac16 100644 (file)
@@ -4,7 +4,7 @@ $(function () {
 
   if (!idData.configured) {
     // eslint-disable-next-line no-alert
 
   if (!idData.configured) {
     // eslint-disable-next-line no-alert
-    alert(I18n.t("site.edit.id_not_configured"));
+    alert(OSM.i18n.t("site.edit.id_not_configured"));
     return;
   }
 
     return;
   }
 
index 899566d392764f049a5a07fd2308a44ca5a3abda..297259043c212efed20aafec5db4704ee96c4ad5 100644 (file)
@@ -9,13 +9,13 @@
 const OSM = { i18n: I18n };
 
 if (navigator.languages) {
 const OSM = { i18n: I18n };
 
 if (navigator.languages) {
-  I18n.locale = navigator.languages[0];
+  OSM.i18n.locale = navigator.languages[0];
 } else if (navigator.language) {
 } else if (navigator.language) {
-  I18n.locale = navigator.language;
+  OSM.i18n.locale = navigator.language;
 }
 
 }
 
-I18n.default_locale = <%= I18n.default_locale.to_json %>;
-I18n.fallbacks = true;
+OSM.i18n.default_locale = <%= I18n.default_locale.to_json %>;
+OSM.i18n.fallbacks = true;
 
 window.onload = function () {
   const args = Object.fromEntries(new URLSearchParams(location.search));
 
 window.onload = function () {
   const args = Object.fromEntries(new URLSearchParams(location.search));
@@ -58,7 +58,7 @@ window.onload = function () {
 L.Control.OSMReportAProblem = L.Control.Attribution.extend({
   options: {
     position: "bottomright",
 L.Control.OSMReportAProblem = L.Control.Attribution.extend({
   options: {
     position: "bottomright",
-    prefix: `<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">${I18n.t("javascripts.embed.report_problem")}</a>`
+    prefix: `<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">${OSM.i18n.t("javascripts.embed.report_problem")}</a>`
   },
 
   onAdd: function (map) {
   },
 
   onAdd: function (map) {
index 0670480d33dfe448e1ca3e9183b3be9d313b2899..fccc9a7b02e6c2a10cb79d772249c46a1e5ad270 100644 (file)
@@ -16,7 +16,7 @@ document.addEventListener("DOMContentLoaded", () => {
   const colorScheme = document.documentElement.getAttribute("data-bs-theme") ?? "auto";
   const rangeColors = ["#14432a", "#166b34", "#37a446", "#4dd05a"];
   const startDate = new Date(Date.now() - (365 * 24 * 60 * 60 * 1000));
   const colorScheme = document.documentElement.getAttribute("data-bs-theme") ?? "auto";
   const rangeColors = ["#14432a", "#166b34", "#37a446", "#4dd05a"];
   const startDate = new Date(Date.now() - (365 * 24 * 60 * 60 * 1000));
-  const monthNames = I18n.t("date.abbr_month_names");
+  const monthNames = OSM.i18n.t("date.abbr_month_names");
 
   const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
 
 
   const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
 
@@ -86,13 +86,13 @@ document.addEventListener("DOMContentLoaded", () => {
   }
 
   function getTooltipText(date, value) {
   }
 
   function getTooltipText(date, value) {
-    const localizedDate = I18n.l("date.formats.long", date);
+    const localizedDate = OSM.i18n.l("date.formats.long", date);
 
     if (value > 0) {
 
     if (value > 0) {
-      return I18n.t("javascripts.heatmap.tooltip.contributions", { count: value, date: localizedDate });
+      return OSM.i18n.t("javascripts.heatmap.tooltip.contributions", { count: value, date: localizedDate });
     }
 
     }
 
-    return I18n.t("javascripts.heatmap.tooltip.no_contributions", { date: localizedDate });
+    return OSM.i18n.t("javascripts.heatmap.tooltip.no_contributions", { date: localizedDate });
   }
 
   function getTheme() {
   }
 
   function getTheme() {
index 9220e12059c9edf5a24865d9585b470a5ba412a9..3924316c175739d8f4884fb727a3b44f896e427f 100644 (file)
@@ -245,7 +245,7 @@ $(function () {
       })
       .catch(() => {
         // eslint-disable-next-line no-alert
       })
       .catch(() => {
         // eslint-disable-next-line no-alert
-        alert(I18n.t("site.index.remote_failed"));
+        alert(OSM.i18n.t("site.index.remote_failed"));
       });
 
     function sendRemoteEditCommand(url) {
       });
 
     function sendRemoteEditCommand(url) {
@@ -266,7 +266,7 @@ $(function () {
       .removeAttr("title")
       .tooltip({
         placement: "bottom",
       .removeAttr("title")
       .tooltip({
         placement: "bottom",
-        title: I18n.t("javascripts.edit_help")
+        title: OSM.i18n.t("javascripts.edit_help")
       })
       .tooltip("show");
 
       })
       .tooltip("show");
 
@@ -280,7 +280,7 @@ $(function () {
 
     page.pushstate = page.popstate = function () {
       map.setSidebarOverlaid(true);
 
     page.pushstate = page.popstate = function () {
       map.setSidebarOverlaid(true);
-      document.title = I18n.t("layouts.project_name.title");
+      document.title = OSM.i18n.t("layouts.project_name.title");
     };
 
     page.load = function () {
     };
 
     page.load = function () {
index 6f85a5252e15a02a42de1b9a8b26f59cb6e3486f..4c157e6e046a800f47fdf2e675903f8404dc806f 100644 (file)
@@ -1,6 +1,6 @@
 OSM.initializeContextMenu = function (map) {
   map.contextmenu.addItem({
 OSM.initializeContextMenu = function (map) {
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.directions_from"),
+    text: OSM.i18n.t("javascripts.context.directions_from"),
     callback: function directionsFromHere(e) {
       const latlng = OSM.cropLocation(e.latlng, map.getZoom());
 
     callback: function directionsFromHere(e) {
       const latlng = OSM.cropLocation(e.latlng, map.getZoom());
 
@@ -12,7 +12,7 @@ OSM.initializeContextMenu = function (map) {
   });
 
   map.contextmenu.addItem({
   });
 
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.directions_to"),
+    text: OSM.i18n.t("javascripts.context.directions_to"),
     callback: function directionsToHere(e) {
       const latlng = OSM.cropLocation(e.latlng, map.getZoom());
 
     callback: function directionsToHere(e) {
       const latlng = OSM.cropLocation(e.latlng, map.getZoom());
 
@@ -24,7 +24,7 @@ OSM.initializeContextMenu = function (map) {
   });
 
   map.contextmenu.addItem({
   });
 
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.add_note"),
+    text: OSM.i18n.t("javascripts.context.add_note"),
     callback: function addNoteHere(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
     callback: function addNoteHere(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
@@ -33,7 +33,7 @@ OSM.initializeContextMenu = function (map) {
   });
 
   map.contextmenu.addItem({
   });
 
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.show_address"),
+    text: OSM.i18n.t("javascripts.context.show_address"),
     callback: function describeLocation(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
     callback: function describeLocation(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
@@ -42,7 +42,7 @@ OSM.initializeContextMenu = function (map) {
   });
 
   map.contextmenu.addItem({
   });
 
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.query_features"),
+    text: OSM.i18n.t("javascripts.context.query_features"),
     callback: function queryFeatures(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
     callback: function queryFeatures(e) {
       const [lat, lon] = OSM.cropLocation(e.latlng, map.getZoom());
 
@@ -51,7 +51,7 @@ OSM.initializeContextMenu = function (map) {
   });
 
   map.contextmenu.addItem({
   });
 
   map.contextmenu.addItem({
-    text: I18n.t("javascripts.context.centre_map"),
+    text: OSM.i18n.t("javascripts.context.centre_map"),
     callback: function centreMap(e) {
       map.panTo(e.latlng);
     }
     callback: function centreMap(e) {
       map.panTo(e.latlng);
     }
index e3f6afa46d4a49a4984a94097347878411b854ff..a4b3a928bbbfa85a68eb5a7647bcaaaa8490efa8 100644 (file)
@@ -117,7 +117,7 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch
       if (json.length === 0) {
         input.addClass("is-invalid");
         // eslint-disable-next-line no-alert
       if (json.length === 0) {
         input.addClass("is-invalid");
         // eslint-disable-next-line no-alert
-        alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value }));
+        alert(OSM.i18n.t("javascripts.directions.errors.no_place", { place: endpoint.value }));
         return;
       }
 
         return;
       }
 
index d2741d02b9489b5f856fd219e12a1e7b84887d0a..05793345327d42714b6d23f308135f83cff528b2 100644 (file)
@@ -72,11 +72,11 @@ OSM.Directions = function (map) {
 
   function formatTotalDistance(m) {
     if (m < 1000) {
 
   function formatTotalDistance(m) {
     if (m < 1000) {
-      return I18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
+      return OSM.i18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
     } else if (m < 10000) {
     } else if (m < 10000) {
-      return I18n.t("javascripts.directions.distance_km", { distance: (m / 1000.0).toFixed(1) });
+      return OSM.i18n.t("javascripts.directions.distance_km", { distance: (m / 1000.0).toFixed(1) });
     } else {
     } else {
-      return I18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) });
+      return OSM.i18n.t("javascripts.directions.distance_km", { distance: Math.round(m / 1000) });
     }
   }
 
     }
   }
 
@@ -84,18 +84,18 @@ OSM.Directions = function (map) {
     if (m < 5) {
       return "";
     } else if (m < 200) {
     if (m < 5) {
       return "";
     } else if (m < 200) {
-      return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 10) * 10) });
+      return OSM.i18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 10) * 10) });
     } else if (m < 1500) {
     } else if (m < 1500) {
-      return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 100) * 100) });
+      return OSM.i18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 100) * 100) });
     } else if (m < 5000) {
     } else if (m < 5000) {
-      return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 100) / 10) });
+      return OSM.i18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 100) / 10) });
     } else {
     } else {
-      return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 1000)) });
+      return OSM.i18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 1000)) });
     }
   }
 
   function formatHeight(m) {
     }
   }
 
   function formatHeight(m) {
-    return I18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
+    return OSM.i18n.t("javascripts.directions.distance_m", { distance: Math.round(m) });
   }
 
   function formatTime(s) {
   }
 
   function formatTime(s) {
@@ -164,13 +164,13 @@ OSM.Directions = function (map) {
       }
 
       const distanceText = $("<p>").append(
       }
 
       const distanceText = $("<p>").append(
-        I18n.t("javascripts.directions.distance") + ": " + formatTotalDistance(route.distance) + ". " +
-        I18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
+        OSM.i18n.t("javascripts.directions.distance") + ": " + formatTotalDistance(route.distance) + ". " +
+        OSM.i18n.t("javascripts.directions.time") + ": " + formatTime(route.time) + ".");
       if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
         distanceText.append(
           $("<br>"),
       if (typeof route.ascend !== "undefined" && typeof route.descend !== "undefined") {
         distanceText.append(
           $("<br>"),
-          I18n.t("javascripts.directions.ascend") + ": " + formatHeight(route.ascend) + ". " +
-          I18n.t("javascripts.directions.descend") + ": " + formatHeight(route.descend) + ".");
+          OSM.i18n.t("javascripts.directions.ascend") + ": " + formatHeight(route.ascend) + ". " +
+          OSM.i18n.t("javascripts.directions.descend") + ": " + formatHeight(route.descend) + ".");
       }
 
       const turnByTurnTable = $("<table class='table table-hover table-sm mb-3'>")
       }
 
       const turnByTurnTable = $("<table class='table table-hover table-sm mb-3'>")
@@ -219,18 +219,18 @@ OSM.Directions = function (map) {
       downloadURL = URL.createObjectURL(blob);
 
       $("#directions_content").append(`<p class="text-center"><a href="${downloadURL}" download="${
       downloadURL = URL.createObjectURL(blob);
 
       $("#directions_content").append(`<p class="text-center"><a href="${downloadURL}" download="${
-        I18n.t("javascripts.directions.filename")
+        OSM.i18n.t("javascripts.directions.filename")
       }">${
       }">${
-        I18n.t("javascripts.directions.download")
+        OSM.i18n.t("javascripts.directions.download")
       }</a></p>`);
 
       $("#directions_content").append("<p class=\"text-center\">" +
       }</a></p>`);
 
       $("#directions_content").append("<p class=\"text-center\">" +
-        I18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
+        OSM.i18n.t("javascripts.directions.instructions.courtesy", { link: chosenEngine.creditline }) +
         "</p>");
     }).catch(function () {
       map.removeLayer(polyline);
       if (reportErrors) {
         "</p>");
     }).catch(function () {
       map.removeLayer(polyline);
       if (reportErrors) {
-        $("#directions_content").html("<div class=\"alert alert-danger\">" + I18n.t("javascripts.directions.errors.no_route") + "</div>");
+        $("#directions_content").html("<div class=\"alert alert-danger\">" + OSM.i18n.t("javascripts.directions.errors.no_route") + "</div>");
       }
     }).finally(function () {
       controller = null;
       }
     }).finally(function () {
       controller = null;
index 2fb835453b67d0e226efad5ef19aafc81d32204f..b2586e68eefc41975d42e3c95e5fd8d745663085 100644 (file)
           } else if (step.ref) {
             name = "<b>" + step.ref + "</b>";
           } else {
           } else if (step.ref) {
             name = "<b>" + step.ref + "</b>";
           } else {
-            name = I18n.t(instrPrefix + "unnamed");
+            name = OSM.i18n.t(instrPrefix + "unnamed");
             namedRoad = false;
           }
 
           if (step.maneuver.type.match(/^exit (rotary|roundabout)$/)) {
             namedRoad = false;
           }
 
           if (step.maneuver.type.match(/^exit (rotary|roundabout)$/)) {
-            instText += I18n.t(template, { name: name });
+            instText += OSM.i18n.t(template, { name: name });
           } else if (step.maneuver.type.match(/^(rotary|roundabout)$/)) {
             if (step.maneuver.exit) {
               if (step.maneuver.exit <= 10) {
           } else if (step.maneuver.type.match(/^(rotary|roundabout)$/)) {
             if (step.maneuver.exit) {
               if (step.maneuver.exit <= 10) {
-                instText += I18n.t(template + "_with_exit_ordinal", { exit: I18n.t(instrPrefix + "exit_counts." + numToWord(step.maneuver.exit)), name: name });
+                instText += OSM.i18n.t(template + "_with_exit_ordinal", { exit: OSM.i18n.t(instrPrefix + "exit_counts." + numToWord(step.maneuver.exit)), name: name });
               } else {
               } else {
-                instText += I18n.t(template + "_with_exit", { exit: step.maneuver.exit, name: name });
+                instText += OSM.i18n.t(template + "_with_exit", { exit: step.maneuver.exit, name: name });
               }
             } else {
               }
             } else {
-              instText += I18n.t(template + "_without_exit", { name: name });
+              instText += OSM.i18n.t(template + "_without_exit", { name: name });
             }
           } else if (step.maneuver.type.match(/^(on ramp|off ramp)$/)) {
             const params = {};
             }
           } else if (step.maneuver.type.match(/^(on ramp|off ramp)$/)) {
             const params = {};
             if (Object.keys(params).length > 0) {
               template = template + "_with_" + Object.keys(params).join("_");
             }
             if (Object.keys(params).length > 0) {
               template = template + "_with_" + Object.keys(params).join("_");
             }
-            instText += I18n.t(template, params);
+            instText += OSM.i18n.t(template, params);
           } else {
           } else {
-            instText += I18n.t(template + "_without_exit", { name: name });
+            instText += OSM.i18n.t(template + "_without_exit", { name: name });
           }
           return [[step.maneuver.location[1], step.maneuver.location[0]], ICON_MAP[maneuver_id], instText, step.distance, step_geometry];
         })
           }
           return [[step.maneuver.location[1], step.maneuver.location[0]], ICON_MAP[maneuver_id], instText, step.distance, step_geometry];
         })
index 8bfb1908f57603ccc6f6ae25052dd8ad66bcde0a..13fc020c2860b5ed305ad74f41e06908fabf379b 100644 (file)
@@ -97,7 +97,7 @@
             costing: costing,
             directions_options: {
               units: "km",
             costing: costing,
             directions_options: {
               units: "km",
-              language: I18n.currentLocale()
+              language: OSM.i18n.currentLocale()
             }
           })
         });
             }
           })
         });
index 14b721d233658a88b3723ad80ac97b5d93c2d891..6a1043fbf366797591f265c206fff86c775ba2d3 100644 (file)
@@ -57,7 +57,7 @@
         // https://graphhopper.com/api/1/docs/routing/
         const query = new URLSearchParams({
           vehicle: vehicleType,
         // https://graphhopper.com/api/1/docs/routing/
         const query = new URLSearchParams({
           vehicle: vehicleType,
-          locale: I18n.currentLocale(),
+          locale: OSM.i18n.currentLocale(),
           key: "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
           elevation: false,
           instructions: true,
           key: "LijBPDQGfu7Iiq80w3HzwB4RUDJbMbhs6BU0dEnn",
           elevation: false,
           instructions: true,
index 7e297b724f4ad7da2fac606c92a690e803589bad..597b68eff4a7216e81cb1c39eacf101cbb1cb8bd 100644 (file)
@@ -18,12 +18,12 @@ OSM.Home = function (map) {
       });
       marker = L.marker(OSM.home, {
         icon: OSM.getUserIcon(),
       });
       marker = L.marker(OSM.home, {
         icon: OSM.getUserIcon(),
-        title: I18n.t("javascripts.home.marker_title")
+        title: OSM.i18n.t("javascripts.home.marker_title")
       }).addTo(map);
     } else {
       $("#browse_status").html(
         $("<div class='m-2 alert alert-warning'>").text(
       }).addTo(map);
     } else {
       $("#browse_status").html(
         $("<div class='m-2 alert alert-warning'>").text(
-          I18n.t("javascripts.home.not_set")
+          OSM.i18n.t("javascripts.home.not_set")
         )
       );
     }
         )
       );
     }
index c0fffd72d061dd140d809f6c6d1daf3a92380493..6452c2a4163d2938a349e44e2b781c7b282e03c4 100644 (file)
@@ -51,15 +51,15 @@ OSM.initializeDataLayer = function (map) {
       $("<div class='p-3'>").append(
         $("<div class='d-flex'>").append(
           $("<h2 class='flex-grow-1 text-break'>")
       $("<div class='p-3'>").append(
         $("<div class='d-flex'>").append(
           $("<h2 class='flex-grow-1 text-break'>")
-            .text(I18n.t("browse.start_rjs.load_data")),
+            .text(OSM.i18n.t("browse.start_rjs.load_data")),
           $("<div>").append(
             $("<button type='button' class='btn-close'>")
           $("<div>").append(
             $("<button type='button' class='btn-close'>")
-              .attr("aria-label", I18n.t("javascripts.close"))
+              .attr("aria-label", OSM.i18n.t("javascripts.close"))
               .click(cancel))),
         $("<p class='alert alert-warning'>")
               .click(cancel))),
         $("<p class='alert alert-warning'>")
-          .text(I18n.t("browse.start_rjs.feature_warning", { num_features })),
+          .text(OSM.i18n.t("browse.start_rjs.feature_warning", { num_features })),
         $("<input type='submit' class='btn btn-primary d-block mx-auto'>")
         $("<input type='submit' class='btn btn-primary d-block mx-auto'>")
-          .val(I18n.t("browse.start_rjs.load_data"))
+          .val(OSM.i18n.t("browse.start_rjs.load_data"))
           .click(add)));
   }
 
           .click(add)));
   }
 
@@ -68,13 +68,13 @@ OSM.initializeDataLayer = function (map) {
       $("<div class='p-3'>").append(
         $("<div class='d-flex'>").append(
           $("<h2 class='flex-grow-1 text-break'>")
       $("<div class='p-3'>").append(
         $("<div class='d-flex'>").append(
           $("<h2 class='flex-grow-1 text-break'>")
-            .text(I18n.t("browse.start_rjs.load_data")),
+            .text(OSM.i18n.t("browse.start_rjs.load_data")),
           $("<div>").append(
             $("<button type='button' class='btn-close'>")
           $("<div>").append(
             $("<button type='button' class='btn-close'>")
-              .attr("aria-label", I18n.t("javascripts.close"))
+              .attr("aria-label", OSM.i18n.t("javascripts.close"))
               .click(close))),
         $("<p class='alert alert-warning'>")
               .click(close))),
         $("<p class='alert alert-warning'>")
-          .text(I18n.t("browse.start_rjs.feature_error", { message: message }))));
+          .text(OSM.i18n.t("browse.start_rjs.feature_error", { message: message }))));
   }
 
   function getData() {
   }
 
   function getData() {
@@ -95,7 +95,7 @@ OSM.initializeDataLayer = function (map) {
       .attr("id", "layers-data-loading")
       .attr("class", "spinner-border spinner-border-sm ms-1")
       .attr("role", "status")
       .attr("id", "layers-data-loading")
       .attr("class", "spinner-border spinner-border-sm ms-1")
       .attr("role", "status")
-      .html("<span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span>")
+      .html("<span class='visually-hidden'>" + OSM.i18n.t("browse.start_rjs.loading") + "</span>")
       .appendTo($("#label-layers-data"));
 
     dataLoader = new AbortController();
       .appendTo($("#label-layers-data"));
 
     dataLoader = new AbortController();
index dfe0adfe2d62fb492309562ec143dfd5fda3bed9..7900574000e1c37fce7ebbedc837f4d97c22cae7 100644 (file)
@@ -69,13 +69,13 @@ OSM.Query = function (map) {
     let prefix = "";
 
     if (tags.boundary === "administrative" && (tags.border_type || tags.admin_level)) {
     let prefix = "";
 
     if (tags.boundary === "administrative" && (tags.border_type || tags.admin_level)) {
-      prefix = I18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
-        defaultValue: I18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
-          defaultValue: I18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
+      prefix = OSM.i18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
+        defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
+          defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
         })
       });
     } else {
         })
       });
     } else {
-      const prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");
+      const prefixes = OSM.i18n.t("geocoder.search_osm_nominatim.prefix");
 
       for (const key in tags) {
         const value = tags[key];
 
       for (const key in tags) {
         const value = tags[key];
@@ -100,7 +100,7 @@ OSM.Query = function (map) {
     }
 
     if (!prefix) {
     }
 
     if (!prefix) {
-      prefix = I18n.t("javascripts.query." + feature.type);
+      prefix = OSM.i18n.t("javascripts.query." + feature.type);
     }
 
     return prefix;
     }
 
     return prefix;
@@ -213,14 +213,14 @@ OSM.Query = function (map) {
         if (results.remark) {
           $("<li>")
             .addClass("list-group-item")
         if (results.remark) {
           $("<li>")
             .addClass("list-group-item")
-            .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
+            .text(OSM.i18n.t("javascripts.query.error", { server: url, error: results.remark }))
             .appendTo($ul);
         }
 
         if ($ul.find("li").length === 0) {
           $("<li>")
             .addClass("list-group-item")
             .appendTo($ul);
         }
 
         if ($ul.find("li").length === 0) {
           $("<li>")
             .addClass("list-group-item")
-            .text(I18n.t("javascripts.query.nothing_found"))
+            .text(OSM.i18n.t("javascripts.query.nothing_found"))
             .appendTo($ul);
         }
       })
             .appendTo($ul);
         }
       })
@@ -231,7 +231,7 @@ OSM.Query = function (map) {
 
         $("<li>")
           .addClass("list-group-item")
 
         $("<li>")
           .addClass("list-group-item")
-          .text(I18n.t("javascripts.query.error", { server: url, error: error.message }))
+          .text(OSM.i18n.t("javascripts.query.error", { server: url, error: error.message }))
           .appendTo($ul);
       });
   }
           .appendTo($ul);
       });
   }
index 45d22feede8f2eec566bbd05a996d195410b4327..a5d7acb430507b98e4ef7c96608bc69f0f835abf 100644 (file)
@@ -31,7 +31,7 @@ L.OSM.key = function (options) {
       button
         .toggleClass("disabled", disabled)
         .attr("data-bs-original-title",
       button
         .toggleClass("disabled", disabled)
         .attr("data-bs-original-title",
-              I18n.t(disabled ?
+              OSM.i18n.t(disabled ?
                 "javascripts.key.tooltip_disabled" :
                 "javascripts.key.tooltip"));
     }
                 "javascripts.key.tooltip_disabled" :
                 "javascripts.key.tooltip"));
     }
index 57d3fc6c03c18442ac916be61efc3c0e9935832f..863a70f32acf72512905034812a3861049ce1c4f 100644 (file)
@@ -81,7 +81,7 @@ L.OSM.layers = function (options) {
         .appendTo($ui);
 
       $("<p>")
         .appendTo($ui);
 
       $("<p>")
-        .text(I18n.t("javascripts.map.layers.overlays"))
+        .text(OSM.i18n.t("javascripts.map.layers.overlays"))
         .attr("class", "text-body-secondary small mb-2")
         .appendTo(overlaySection);
 
         .attr("class", "text-body-secondary small mb-2")
         .appendTo(overlaySection);
 
@@ -94,7 +94,7 @@ L.OSM.layers = function (options) {
 
         if (name === "notes" || name === "data") {
           item
 
         if (name === "notes" || name === "data") {
           item
-            .attr("title", I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
+            .attr("title", OSM.i18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip"))
             .tooltip("disable");
         }
 
             .tooltip("disable");
         }
 
@@ -111,7 +111,7 @@ L.OSM.layers = function (options) {
           .prop("checked", checked)
           .appendTo(label);
 
           .prop("checked", checked)
           .appendTo(label);
 
-        label.append(I18n.t("javascripts.map.layers." + name));
+        label.append(OSM.i18n.t("javascripts.map.layers." + name));
 
         input.on("change", function () {
           checked = input.is(":checked");
 
         input.on("change", function () {
           checked = input.is(":checked");
index 81b4f1a4eef496fd1691c54e61c9cac43d00e960..d270d6499af98485c4984ae6a6ee55030eb3985b 100644 (file)
@@ -3,9 +3,9 @@ L.OSM.locate = function (options) {
     icon: "icon geolocate",
     iconLoading: "icon geolocate",
     strings: {
     icon: "icon geolocate",
     iconLoading: "icon geolocate",
     strings: {
-      title: I18n.t("javascripts.map.locate.title"),
+      title: OSM.i18n.t("javascripts.map.locate.title"),
       popup: function (options) {
       popup: function (options) {
-        return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+        return OSM.i18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
       }
     },
     ...options
       }
     },
     ...options
index c63c4a2815b98313b5ce32c1ec7641a553c81eba..ac31f79416034e1f894e7cefbedcfdd678606b0c 100644 (file)
@@ -23,7 +23,7 @@ L.OSM.Map = L.Map.extend({
         if (property === "credit") {
           layerOptions.attribution = makeAttribution(value);
         } else if (property === "nameId") {
         if (property === "credit") {
           layerOptions.attribution = makeAttribution(value);
         } else if (property === "nameId") {
-          layerOptions.name = I18n.t(`javascripts.map.base.${value}`);
+          layerOptions.name = OSM.i18n.t(`javascripts.map.base.${value}`);
         } else if (property === "leafletOsmId") {
           layerConstructor = L.OSM[value];
         } else if (property === "leafletOsmDarkId" && OSM.isDarkMap() && L.OSM[value]) {
         } else if (property === "leafletOsmId") {
           layerConstructor = L.OSM[value];
         } else if (property === "leafletOsmDarkId" && OSM.isDarkMap() && L.OSM[value]) {
@@ -66,10 +66,10 @@ L.OSM.Map = L.Map.extend({
     function makeAttribution(credit) {
       let attribution = "";
 
     function makeAttribution(credit) {
       let attribution = "";
 
-      attribution += I18n.t("javascripts.map.copyright_text", {
+      attribution += OSM.i18n.t("javascripts.map.copyright_text", {
         copyright_link: $("<a>", {
           href: "/copyright",
         copyright_link: $("<a>", {
           href: "/copyright",
-          text: I18n.t("javascripts.map.openstreetmap_contributors")
+          text: OSM.i18n.t("javascripts.map.openstreetmap_contributors")
         }).prop("outerHTML")
       });
 
         }).prop("outerHTML")
       });
 
@@ -79,7 +79,7 @@ L.OSM.Map = L.Map.extend({
 
       attribution += $("<a>", {
         href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
 
       attribution += $("<a>", {
         href: "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
-        text: I18n.t("javascripts.map.website_and_api_terms")
+        text: OSM.i18n.t("javascripts.map.website_and_api_terms")
       }).prop("outerHTML");
 
       return attribution;
       }).prop("outerHTML");
 
       return attribution;
@@ -90,7 +90,7 @@ L.OSM.Map = L.Map.extend({
       for (const childId in credit.children) {
         children[childId] = makeCredit(credit.children[childId]);
       }
       for (const childId in credit.children) {
         children[childId] = makeCredit(credit.children[childId]);
       }
-      const text = I18n.t(`javascripts.map.${credit.id}`, children);
+      const text = OSM.i18n.t(`javascripts.map.${credit.id}`, children);
       if (credit.href) {
         const link = $("<a>", {
           href: credit.href,
       if (credit.href) {
         const link = $("<a>", {
           href: credit.href,
index e2ca4ffdfda3409580525a33df000b08d1e66c6f..e093d371e068e11b9b7d732d2ae599c77fc3dcaf 100644 (file)
@@ -18,7 +18,7 @@ L.OSM.note = function (options) {
             isDisabled = OSM.STATUS === "database_offline" || map.getZoom() < 12;
       link
         .toggleClass("disabled", isDisabled)
             isDisabled = OSM.STATUS === "database_offline" || map.getZoom() < 12;
       link
         .toggleClass("disabled", isDisabled)
-        .attr("data-bs-original-title", I18n.t(isDisabled ?
+        .attr("data-bs-original-title", OSM.i18n.t(isDisabled ?
           "javascripts.site.createnote_disabled_tooltip" :
           "javascripts.site.createnote_tooltip"));
       if (isDisabled === wasDisabled) return;
           "javascripts.site.createnote_disabled_tooltip" :
           "javascripts.site.createnote_tooltip"));
       if (isDisabled === wasDisabled) return;
index 04176487757aac1b95c2d440e2115ecbfaa2c19f..3dfa71d0e4745649ee6286466554b1c9d220e5a0 100644 (file)
@@ -18,7 +18,7 @@ L.OSM.query = function (options) {
             isDisabled = map.getZoom() < 14;
       link
         .toggleClass("disabled", isDisabled)
             isDisabled = map.getZoom() < 14;
       link
         .toggleClass("disabled", isDisabled)
-        .attr("data-bs-original-title", I18n.t(isDisabled ?
+        .attr("data-bs-original-title", OSM.i18n.t(isDisabled ?
           "javascripts.site.queryfeature_disabled_tooltip" :
           "javascripts.site.queryfeature_tooltip"));
       if (isDisabled === wasDisabled) return;
           "javascripts.site.queryfeature_disabled_tooltip" :
           "javascripts.site.queryfeature_tooltip"));
       if (isDisabled === wasDisabled) return;
index d84f8820e3e0a37966470cc8ac43c88bf9dabd1f..fedfc4d316d2cf8002e62657154cf570c66dcae9 100644 (file)
@@ -15,7 +15,7 @@ L.OSM.share = function (options) {
       .appendTo($ui);
 
     $("<h4>")
       .appendTo($ui);
 
     $("<h4>")
-      .text(I18n.t("javascripts.share.link"))
+      .text(OSM.i18n.t("javascripts.share.link"))
       .appendTo($linkSection);
 
     let $form = $("<form>")
       .appendTo($linkSection);
 
     let $form = $("<form>")
@@ -27,7 +27,7 @@ L.OSM.share = function (options) {
       .append($("<label>")
         .attr("for", "link_marker")
         .attr("class", "form-check-label")
       .append($("<label>")
         .attr("for", "link_marker")
         .attr("class", "form-check-label")
-        .text(I18n.t("javascripts.share.include_marker")))
+        .text(OSM.i18n.t("javascripts.share.include_marker")))
       .append($("<input>")
         .attr("id", "link_marker")
         .attr("type", "checkbox")
       .append($("<input>")
         .attr("id", "link_marker")
         .attr("type", "checkbox")
@@ -40,17 +40,17 @@ L.OSM.share = function (options) {
         .addClass("active")
         .attr("for", "long_input")
         .attr("id", "long_link")
         .addClass("active")
         .attr("for", "long_input")
         .attr("id", "long_link")
-        .text(I18n.t("javascripts.share.long_link")))
+        .text(OSM.i18n.t("javascripts.share.long_link")))
       .append($("<a class='btn btn-primary'>")
         .attr("for", "short_input")
         .attr("id", "short_link")
       .append($("<a class='btn btn-primary'>")
         .attr("for", "short_input")
         .attr("id", "short_link")
-        .text(I18n.t("javascripts.share.short_link")))
+        .text(OSM.i18n.t("javascripts.share.short_link")))
       .append($("<a class='btn btn-primary'>")
         .attr("for", "embed_html")
         .attr("id", "embed_link")
       .append($("<a class='btn btn-primary'>")
         .attr("for", "embed_html")
         .attr("id", "embed_link")
-        .attr("data-bs-title", I18n.t("javascripts.site.embed_html_disabled"))
+        .attr("data-bs-title", OSM.i18n.t("javascripts.site.embed_html_disabled"))
         .attr("href", "#")
         .attr("href", "#")
-        .text(I18n.t("javascripts.share.embed")))
+        .text(OSM.i18n.t("javascripts.share.embed")))
       .on("click", "a", function (e) {
         e.preventDefault();
         if (!$(this).hasClass("btn-primary")) return;
       .on("click", "a", function (e) {
         e.preventDefault();
         if (!$(this).hasClass("btn-primary")) return;
@@ -100,7 +100,7 @@ L.OSM.share = function (options) {
       .append(
         $("<p>")
           .attr("class", "text-body-secondary")
       .append(
         $("<p>")
           .attr("class", "text-body-secondary")
-          .text(I18n.t("javascripts.share.paste_html")));
+          .text(OSM.i18n.t("javascripts.share.paste_html")));
 
     // Geo URI
 
 
     // Geo URI
 
@@ -109,7 +109,7 @@ L.OSM.share = function (options) {
       .appendTo($ui);
 
     $("<h4>")
       .appendTo($ui);
 
     $("<h4>")
-      .text(I18n.t("javascripts.share.geo_uri"))
+      .text(OSM.i18n.t("javascripts.share.geo_uri"))
       .appendTo($geoUriSection);
 
     $("<div>")
       .appendTo($geoUriSection);
 
     $("<div>")
@@ -124,13 +124,13 @@ L.OSM.share = function (options) {
       .appendTo($ui);
 
     $("<h4>")
       .appendTo($ui);
 
     $("<h4>")
-      .text(I18n.t("javascripts.share.image"))
+      .text(OSM.i18n.t("javascripts.share.image"))
       .appendTo($imageSection);
 
     $("<div>")
       .attr("id", "export-warning")
       .attr("class", "text-body-secondary")
       .appendTo($imageSection);
 
     $("<div>")
       .attr("id", "export-warning")
       .attr("class", "text-body-secondary")
-      .text(I18n.t("javascripts.share.only_layers_exported_as_image"))
+      .text(OSM.i18n.t("javascripts.share.only_layers_exported_as_image"))
       .append(
         $("<ul>").append(
           map.baseLayers
       .append(
         $("<ul>").append(
           map.baseLayers
@@ -150,7 +150,7 @@ L.OSM.share = function (options) {
       .append($("<label>")
         .attr("for", "mapnik_format")
         .attr("class", "col-auto col-form-label")
       .append($("<label>")
         .attr("for", "mapnik_format")
         .attr("class", "col-auto col-form-label")
-        .text(I18n.t("javascripts.share.format")))
+        .text(OSM.i18n.t("javascripts.share.format")))
       .append($("<div>")
         .attr("class", "col-auto")
         .append($("<select>")
       .append($("<div>")
         .attr("class", "col-auto")
         .append($("<select>")
@@ -170,7 +170,7 @@ L.OSM.share = function (options) {
       .append($("<label>")
         .attr("for", "mapnik_scale")
         .attr("class", "col-auto col-form-label")
       .append($("<label>")
         .attr("for", "mapnik_scale")
         .attr("class", "col-auto col-form-label")
-        .text(I18n.t("javascripts.share.scale")))
+        .text(OSM.i18n.t("javascripts.share.scale")))
       .append($("<div>")
         .attr("class", "col-auto")
         .append($("<div>")
       .append($("<div>")
         .attr("class", "col-auto")
         .append($("<div>")
@@ -195,7 +195,7 @@ L.OSM.share = function (options) {
           .append($("<label>")
             .attr("for", "image_filter")
             .attr("class", "form-check-label")
           .append($("<label>")
             .attr("for", "image_filter")
             .attr("class", "form-check-label")
-            .text(I18n.t("javascripts.share.custom_dimensions")))
+            .text(OSM.i18n.t("javascripts.share.custom_dimensions")))
           .append($("<input>")
             .attr("id", "image_filter")
             .attr("type", "checkbox")
           .append($("<input>")
             .attr("id", "image_filter")
             .attr("type", "checkbox")
@@ -243,13 +243,13 @@ L.OSM.share = function (options) {
 
     $("<p>")
       .attr("class", "text-body-secondary")
 
     $("<p>")
       .attr("class", "text-body-secondary")
-      .html(I18n.t("javascripts.share.image_dimensions", args))
+      .html(OSM.i18n.t("javascripts.share.image_dimensions", args))
       .appendTo($form);
 
     $("<input>")
       .attr("type", "submit")
       .attr("class", "btn btn-primary")
       .appendTo($form);
 
     $("<input>")
       .attr("type", "submit")
       .attr("class", "btn btn-primary")
-      .attr("value", I18n.t("javascripts.share.download"))
+      .attr("value", OSM.i18n.t("javascripts.share.download"))
       .appendTo($form);
 
     locationFilter
       .appendTo($form);
 
     locationFilter
@@ -371,7 +371,7 @@ L.OSM.share = function (options) {
           escapeHTML(OSM.SERVER_PROTOCOL + "://" + OSM.SERVER_URL + "/export/embed.html?" + params) +
           "\" style=\"border: 1px solid black\"></iframe><br/>" +
           "<small><a href=\"" + escapeHTML(map.getUrl(marker)) + "\">" +
           escapeHTML(OSM.SERVER_PROTOCOL + "://" + OSM.SERVER_URL + "/export/embed.html?" + params) +
           "\" style=\"border: 1px solid black\"></iframe><br/>" +
           "<small><a href=\"" + escapeHTML(map.getUrl(marker)) + "\">" +
-          escapeHTML(I18n.t("javascripts.share.view_larger_map")) + "</a></small>");
+          escapeHTML(OSM.i18n.t("javascripts.share.view_larger_map")) + "</a></small>");
 
       // Geo URI
 
 
       // Geo URI
 
index 7408585f26adbd19dfd1f57d3d87fd49c16fab6e..eb96acf75c3e94d33f2e3532efb548c4c622c820 100644 (file)
@@ -12,7 +12,7 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
       .on("click", toggle);
 
     if (buttonTitle) {
       .on("click", toggle);
 
     if (buttonTitle) {
-      button.attr("title", I18n.t(buttonTitle));
+      button.attr("title", OSM.i18n.t(buttonTitle));
     }
 
     button.appendTo($container);
     }
 
     button.appendTo($container);
@@ -21,7 +21,7 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
       .attr("class", `${uiClass}-ui position-relative z-n1`);
 
     $("<h2 class='p-3 pb-0 pe-5 text-break'>")
       .attr("class", `${uiClass}-ui position-relative z-n1`);
 
     $("<h2 class='p-3 pb-0 pe-5 text-break'>")
-      .text(I18n.t(paneTitle))
+      .text(OSM.i18n.t(paneTitle))
       .appendTo($ui);
 
     options.sidebar.addPane($ui);
       .appendTo($ui);
 
     options.sidebar.addPane($ui);
index 71662608c5febec3873145bfda8e8e63bacc734e..1947b631d06c8f9474859c18d086a2afe2cf2bce 100644 (file)
@@ -10,9 +10,9 @@ L.OSM.Zoom = L.Control.extend({
     this._map = map;
 
     this._zoomInButton = this._createButton(
     this._map = map;
 
     this._zoomInButton = this._createButton(
-      "", I18n.t("javascripts.map.zoom.in"), zoomName + "in", container, this._zoomIn, this);
+      "", OSM.i18n.t("javascripts.map.zoom.in"), zoomName + "in", container, this._zoomIn, this);
     this._zoomOutButton = this._createButton(
     this._zoomOutButton = this._createButton(
-      "", I18n.t("javascripts.map.zoom.out"), zoomName + "out", container, this._zoomOut, this);
+      "", OSM.i18n.t("javascripts.map.zoom.out"), zoomName + "out", container, this._zoomOut, this);
 
     map.on("zoomend zoomlevelschange", this._updateDisabled, this);
 
 
     map.on("zoomend zoomlevelschange", this._updateDisabled, this);
 
index f3fe02e0c55ac714435ca5b04046385e44b2da29..77a71097b1d41d899372c043e5341ba8f1ce2e27 100644 (file)
@@ -26,9 +26,9 @@ $(function () {
       icon: "icon geolocate",
       iconLoading: "icon geolocate",
       strings: {
       icon: "icon geolocate",
       iconLoading: "icon geolocate",
       strings: {
-        title: I18n.t("javascripts.map.locate.title"),
+        title: OSM.i18n.t("javascripts.map.locate.title"),
         popup: function (options) {
         popup: function (options) {
-          return I18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
+          return OSM.i18n.t("javascripts.map.locate." + options.unit + "Popup", { count: options.distance });
         }
       }
     }).addTo(map);
         }
       }
     }).addTo(map);
@@ -210,7 +210,7 @@ $(function () {
   });
 
   $("input[name=legale]").change(function () {
   });
 
   $("input[name=legale]").change(function () {
-    $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + I18n.t("browse.start_rjs.loading") + "</span></div>");
+    $("#contributorTerms").html("<div class='spinner-border' role='status'><span class='visually-hidden'>" + OSM.i18n.t("browse.start_rjs.loading") + "</span></div>");
     fetch($(this).data("url"))
       .then(r => r.text())
       .then(html => { $("#contributorTerms").html(html); });
     fetch($(this).data("url"))
       .then(r => r.text())
       .then(html => { $("#contributorTerms").html(html); });