]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into convert_roundabout_exits
authorJamie Guthrie <jguthrie100@users.noreply.github.com>
Sun, 29 Apr 2018 18:53:57 +0000 (19:53 +0100)
committerGitHub <noreply@github.com>
Sun, 29 Apr 2018 18:53:57 +0000 (19:53 +0100)
app/assets/javascripts/index/directions/osrm.js
config/locales/en.yml

index 84f085c5a6c942cc16f0cc8fcb6344989d7ff2db..e249ce1f56311c29f3119d5785484bc9adb3090a 100644 (file)
@@ -60,6 +60,12 @@ function OSRMEngine() {
         'depart': 8,
         'arrive': 14
       };
+      var numToWord = function(num) {
+        if(num > 10) {
+          num = 11;
+        }
+        return ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "gt_ten"][num];
+      };
       var transformed_steps = input_steps.map(function(step, idx) {
         var maneuver_id;
 
@@ -112,7 +118,7 @@ function OSRMEngine() {
 
         if (step.maneuver.type.match(/rotary|roundabout/)) {
           if (step.maneuver.exit) {
-            instText += I18n.t(template + '_with_exit', { exit: step.maneuver.exit, name: name } );
+            instText += I18n.t(template + '_with_exit', { exit: I18n.t('javascripts.directions.instructions.exit_counts.' + numToWord(step.maneuver.exit)), name: name } );
           } else {
             instText += I18n.t(template + '_without_exit', { name: name } );
           }
index fd0317df11581af61fb24a2954041f264159d416..a2a575492bc5b4939f643622960147f34904e225 100644 (file)
@@ -2384,6 +2384,18 @@ en:
         continue_with_exit: Exit onto %{name}
         unnamed: "unnamed road"
         courtesy: "Directions courtesy of %{link}"
+        exit_counts:
+          one: "1st"
+          two: "2nd"
+          three: "3rd"
+          four: "4th"
+          five: "5th"
+          six: "6th"
+          seven: "7th"
+          eight: "8th"
+          nine: "9th"
+          ten: "10th"
+          gt_ten: ""
       time: "Time"
     query:
       node: Node