]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/osrm.js
Fix OSRM directions issues
[rails.git] / app / assets / javascripts / index / directions / osrm.js
index 842909eabc47cb5e4dc2d920b0013846f4ccae93..2156bf309252c4e1fa50c3f0e657e0fe8e71bcf1 100644 (file)
@@ -44,7 +44,7 @@ function OSRMEngine() {
         url += "&checksum=" + hintData.checksum;
       }
 
-      $.ajax({
+      return $.ajax({
         url: url,
         dataType: 'json',
         success: function (data) {
@@ -66,9 +66,10 @@ function OSRMEngine() {
             var instText = "<b>" + (i + 1) + ".</b> ";
             instText += TURN_INSTRUCTIONS[instCodes[0]];
             if (instCodes[1]) {
-              instText += "exit " + instCodes[1] + " ";
+              instText += I18n.t('javascripts.directions.instructions.exit', { exit: instCodes[1] } );
             }
             if (instCodes[0] !== 15) {
+              instText += " ";
               instText += s[1] ? "<b>" + s[1] + "</b>" : I18n.t('javascripts.directions.instructions.unnamed');
             }
             if ((i + 1) < data.route_instructions.length) {