diff --git a/WebContent/localization/OSRM.Locale.de.js b/WebContent/localization/OSRM.Locale.de.js index 20094d1d6..b0029cab0 100644 --- a/WebContent/localization/OSRM.Locale.de.js +++ b/WebContent/localization/OSRM.Locale.de.js @@ -57,8 +57,30 @@ OSRM.Localization["de"] = { "NO": "Nordost", "SO": "Südost", "SW": "Südwest", -"NW": "Nordwest" +"NW": "Nordwest", +// driving directions +"DIRECTION_1":"Links abbiegen[ auf %s]", +"DIRECTION_2":"Rechts abbiegen[ auf %s]", +"DIRECTION_3":"Umkehren[ auf %s]", +"DIRECTION_4":"Fahren Sie Richtung %s", +"DIRECTION_5":"Weiterfahren[ auf %s]", +"DIRECTION_6":"Leicht links abbiegen[ auf %s]", +"DIRECTION_7":"Leicht rechts abbiegen[ auf %s]", +"DIRECTION_8":"Scharf links abbiegen[ auf %s]", +"DIRECTION_9":"Scharf rechts abbiegen[ auf %s]", +"DIRECTION_10":"In den Kreisverkehr einfahren und bei erster Möglichkeit verlassen[ auf %s]", +"DIRECTION_11":"In den Kreisverkehr einfahren und bei zweiter Möglichkeit verlassen[ auf %s]", +"DIRECTION_12":"In den Kreisverkehr einfahren und bei dritter Möglichkeit verlassen[ auf %s]", +"DIRECTION_13":"In den Kreisverkehr einfahren und bei vierter Möglichkeit verlassen[ auf %s]", +"DIRECTION_14":"In den Kreisverkehr einfahren und bei f�nfter Möglichkeit verlassen[ auf %s]", +"DIRECTION_15":"In den Kreisverkehr einfahren und bei sechster Möglichkeit verlassen[ auf %s]", +"DIRECTION_16":"In den Kreisverkehr einfahren und bei siebter Möglichkeit verlassen[ auf %s]", +"DIRECTION_17":"In den Kreisverkehr einfahren und bei achter Möglichkeit verlassen[ auf %s]", +"DIRECTION_18":"In den Kreisverkehr einfahren und bei neunter Möglichkeit verlassen[ auf %s]", +"DIRECTION_19":"In den Kreisverkehr einfahren und bei zehnter Möglichkeit verlassen[ auf %s]", +"DIRECTION_20":"In den Kreisverkehr einfahren und bei einer der vielen Möglichkeiten verlassen[ auf %s]", +"DIRECTION_21":"Sie haben Ihr Ziel erreicht" }; // set GUI language on load -OSRM.GUI.setLanguage(); \ No newline at end of file +OSRM.Localization.change("de"); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Locale.en.js b/WebContent/localization/OSRM.Locale.en.js index 686eb30bb..a063d9fa5 100644 --- a/WebContent/localization/OSRM.Locale.en.js +++ b/WebContent/localization/OSRM.Locale.en.js @@ -57,8 +57,30 @@ OSRM.Localization["en"] = { "NE": "northeast", "SE": "southeast", "SW": "southwest", -"NW": "northwest" +"NW": "northwest", +// driving directions +"DIRECTION_1":"Turn left[ on %s]", +"DIRECTION_2":"Turn right[ on %s]", +"DIRECTION_3":"U-Turn[ on %s]", +"DIRECTION_4":"Head %s", +"DIRECTION_5":"Continue[ on %s]", +"DIRECTION_6":"Turn slight left[ on %s]", +"DIRECTION_7":"Turn slight right[ on %s]", +"DIRECTION_8":"Turn sharp left[ on %s]", +"DIRECTION_9":"Turn sharp right[ on %s]", +"DIRECTION_10":"Enter roundabout and leave at first exit[ on %s]", +"DIRECTION_11":"Enter roundabout and leave at second exit[ on %s]", +"DIRECTION_12":"Enter roundabout and leave at third exit[ on %s]", +"DIRECTION_13":"Enter roundabout and leave at fourth exit[ on %s]", +"DIRECTION_14":"Enter roundabout and leave at fifth exit[ on %s]", +"DIRECTION_15":"Enter roundabout and leave at sixth exit[ on %s]", +"DIRECTION_16":"Enter roundabout and leave at seventh exit[ on %s]", +"DIRECTION_17":"Enter roundabout and leave at eighth exit[ on %s]", +"DIRECTION_18":"Enter roundabout and leave at nineth exit[ on %s]", +"DIRECTION_19":"Enter roundabout and leave at tenth exit[ on %s]", +"DIRECTION_20":"Enter roundabout and leave at one of the too many exits[ on %s]", +"DIRECTION_21":"You have reached your destination" }; //set GUI language on load -OSRM.GUI.setLanguage(); \ No newline at end of file +OSRM.Localization.change("en"); \ No newline at end of file diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index 597e939b0..2e5ce7415 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -51,6 +51,8 @@ change: function(language) { OSRM.DEFAULTS.LANGUAGE = language; if( OSRM.Localization[language]) { OSRM.GUI.setLanguage(); + if( document.getElementById('information-box').innerHTML != "" ) + OSRM.RoutingDescription.show( OSRM.G.response ); } else { var script = document.createElement('script'); script.type = 'text/javascript'; diff --git a/WebContent/routing/OSRM.RoutingDescription.js b/WebContent/routing/OSRM.RoutingDescription.js index 19911efb1..5d236fb4e 100644 --- a/WebContent/routing/OSRM.RoutingDescription.js +++ b/WebContent/routing/OSRM.RoutingDescription.js @@ -72,6 +72,15 @@ show: function(response) { route_desc += ''; route_desc += ''; + +// // build route description +// if( i == 0 ) +// route_desc += OSRM.loc("DIRECTION_"+response.route_instructions[i][0]).replace(/%s/, response.route_instructions[i][6]); +// else if( response.route_instructions[i][1] != "" ) +// route_desc += OSRM.loc("DIRECTION_"+response.route_instructions[i][0]).replace(/\[(.*)\]/,""); +// else +// route_desc += OSRM.loc("DIRECTION_"+response.route_instructions[i][0]).replace(/\[(.*)\]/,"$1").replace(/%s/, response.route_instructions[i][6]); + route_desc += response.route_instructions[i][0]; if( i == 0 ) route_desc += ' ' + OSRM.loc( response.route_instructions[i][6] );