Fix OSRM directions issues

Don't rely on trailing spaces in translation strings as they
aren't reliably preserved, and make "exit" translatable.

Fixes #915
This commit is contained in:
Tom Hughes 2015-02-27 17:00:28 +00:00
parent 2d1adf4fe1
commit fa3ccdfd49
2 changed files with 20 additions and 18 deletions

View file

@ -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) {