X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6b9e70573bd21631f0e320c3aadecc7e0be70aa0..957d75295b2c379b17e61a2a22ee28fb5f701589:/app/assets/javascripts/index/directions/osrm.js
diff --git a/app/assets/javascripts/index/directions/osrm.js b/app/assets/javascripts/index/directions/osrm.js
index 05cb32f20..2156bf309 100644
--- a/app/assets/javascripts/index/directions/osrm.js
+++ b/app/assets/javascripts/index/directions/osrm.js
@@ -44,11 +44,11 @@ function OSRMEngine() {
url += "&checksum=" + hintData.checksum;
}
- $.ajax({
+ return $.ajax({
url: url,
dataType: 'json',
success: function (data) {
- if (data.status == 207)
+ if (data.status === 207)
return callback(true);
previousPoints = points;
@@ -66,9 +66,10 @@ function OSRMEngine() {
var instText = "" + (i + 1) + ". ";
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) {
+ if (instCodes[0] !== 15) {
+ instText += " ";
instText += s[1] ? "" + s[1] + "" : I18n.t('javascripts.directions.instructions.unnamed');
}
if ((i + 1) < data.route_instructions.length) {
@@ -91,4 +92,4 @@ function OSRMEngine() {
};
}
-OSM.Directions.addEngine(OSRMEngine(), true);
+OSM.Directions.addEngine(new OSRMEngine(), true);