Fix directions for roundabout without exit number
authorJamie Guthrie <jamie.guthrie@gmail.com>
Thu, 15 Feb 2018 09:53:00 +0000 (09:53 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 15 Feb 2018 17:53:54 +0000 (17:53 +0000)
Closes #1756

app/assets/javascripts/index/directions/osrm.js
config/locales/en.yml

index 5c29f6c..e31c053 100644 (file)
@@ -111,7 +111,11 @@ function OSRMEngine() {
         }
 
         if (step.maneuver.type.match(/rotary|roundabout/)) {
-          instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
+          if (step.maneuver.exit) {
+            instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
+          } else {
+            instText += I18n.t(template + '_without_exit', { name: name } );
+          }
         } else if (step.maneuver.type.match(/on ramp|off ramp/)) {
           if (step.destinations) {
             if (namedRoad) {
index 838e657..2412a2b 100644 (file)
@@ -2360,7 +2360,7 @@ en:
         slight_left_without_exit: Slight left onto %{name}
         via_point_without_exit: (via point)
         follow_without_exit: Follow %{name}
-        roundabout_without_exit: At roundabout take %{name}
+        roundabout_without_exit: At roundabout take exit onto %{name}
         leave_roundabout_without_exit: Leave roundabout - %{name}
         stay_roundabout_without_exit: Stay on roundabout - %{name}
         start_without_exit: Start on %{name}