Add new ordinals array to turn instructions internationalized.

This commit is contained in:
Moises Arcos 2012-02-24 09:16:12 +01:00
parent 93e20c1843
commit 1e9e63ad9f
4 changed files with 38 additions and 18 deletions

View File

@ -53,8 +53,6 @@ struct TurnInstructionsClass {
//This is a hack until c++0x is available enough to use initializer lists. //This is a hack until c++0x is available enough to use initializer lists.
TurnInstructionsClass(string nameFile){ TurnInstructionsClass(string nameFile){
// Ahora mismo la ruta estñá puesta de manera manual
//char nameFile[] = "/home/usuario/workspace/Project-OSRM/DataStructures/languages/ES_ES.txt";
// Declare an input file stream // Declare an input file stream
ifstream fread; ifstream fread;
// Open a file for only read // Open a file for only read
@ -70,27 +68,17 @@ struct TurnInstructionsClass {
int i = 0; int i = 0;
while (!fread.eof()){ while (!fread.eof()){
/* Write the result in an array */ /* Write the result in an array */
if(i<15){
std::string str(buffer); std::string str(buffer);
if(i<15){
TurnStrings[i] = str; TurnStrings[i] = str;
i++; }else if(i>=15 && i<26){
Ordinals[i-15] = str;
} }
/* Read the next line */ /* Read the next line */
i++;
fread.getline(buffer, 128); fread.getline(buffer, 128);
} }
fread.close(); fread.close();
Ordinals[0] = "zeroth";
Ordinals[1] = "first";
Ordinals[2] = "second";
Ordinals[3] = "third";
Ordinals[4] = "fourth";
Ordinals[5] = "fifth";
Ordinals[6] = "sixth";
Ordinals[7] = "seventh";
Ordinals[8] = "eighth";
Ordinals[9] = "nineth";
Ordinals[10] = "tenth";
}; };
static inline double GetTurnDirectionOfInstruction( const double angle ) { static inline double GetTurnDirectionOfInstruction( const double angle ) {

View File

@ -13,3 +13,14 @@ Enter round-about
Leave round-about Leave round-about
Stay on round-about Stay on round-about
Start Start
zeroth
first
second
third
fourth
fifth
sixth
seventh
eighth
nineth
tenth

View File

@ -13,3 +13,14 @@ Introduzca rotonda
Deja rotonda Deja rotonda
Permanezca en rotonda Permanezca en rotonda
Comenzar Comenzar
cero
primero
segundo
tercero
cuarto
quinto
sexto
séptimo
octavo
noveno
décimo

View File

@ -13,4 +13,14 @@ Entrez rond-point
Laissez rond-point Laissez rond-point
Rester sur rond-point Rester sur rond-point
Commencer Commencer
zéro
première
deuxième
troisième
quatrième
cinquième
sixième
septième
huitième
neuvième
dixième