]> git.openstreetmap.org Git - rails.git/commitdiff
Translate step distance units
authorAnton Khorev <tony29@yandex.ru>
Sun, 9 Mar 2025 13:39:01 +0000 (16:39 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sun, 9 Mar 2025 14:16:05 +0000 (17:16 +0300)
app/assets/javascripts/index/directions.js

index eb1b9d0df046b3fe34c41988dcf930bacd6d5aa5..aee262e02518188f23b1adab4cc8bf60278af5e1 100644 (file)
@@ -84,13 +84,13 @@ OSM.Directions = function (map) {
     if (m < 5) {
       return "";
     } else if (m < 200) {
-      return String(Math.round(m / 10) * 10) + "m";
+      return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 10) * 10) });
     } else if (m < 1500) {
-      return String(Math.round(m / 100) * 100) + "m";
+      return I18n.t("javascripts.directions.distance_m", { distance: String(Math.round(m / 100) * 100) });
     } else if (m < 5000) {
-      return String(Math.round(m / 100) / 10) + "km";
+      return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 100) / 10) });
     } else {
-      return String(Math.round(m / 1000)) + "km";
+      return I18n.t("javascripts.directions.distance_km", { distance: String(Math.round(m / 1000)) });
     }
   }