DennisOSRM/Project-OSRM — pull request #144 by moiarcsan (2012-02-24 13:02:02+00:00)
Title: Adding translations

I add code to do the internationalization from your code to another languages (Example: Spanish and French).
When you do a request to OSRM to get the path from a source to target, always it returns a JSON with the turn instructions in English.

With my code you can change the language of this instructions for another different language, to do that you have to add a text file into the folder Datastructures/language, when you write down the turn instructions and the ordinals in the language that you want. You have to add on the request one more parameter which name is "lang", for example this request: viaroute?start=40.413498,-3.702735&dest=40.413,-3.7027&lang=ES_ES

The JSON response is now internationalized because it is able to read the file text and compare with the language of the request parameter "lang" and choice the turn instructions from file which name is the same as the value parameter.