Hi.

It's very simple. I create a header file with an enumeration, like this:

enum LanguageMessage
{
        lmApplicationExitQuestion,
        lmApplicationExiting,
        /*...*/
}

Each element of the enumeration indexes a message line of one or more text 
files. I create a text file for each language, like English.txt, Spanish.txt, 
French.txt, etc. These files contain a message per line. Examples:

English.txt:
        Quit. Are you sure?
        Exiting application...

Spanish.txt:
        ¿Salir de la aplicación?
        Cerrando la aplicación...

Then I convert each text file to a different .pdb file (English.pdb, 
Spanish.pdb, and so on). The .pdb has a record for each line of the source text 
file. [It could be inefficient, but easy to program].

In my palm application, I build a list of "installed languages" searching for 
the .pdbs (using the Creator ID and Database type fields). I let to the user 
choose the language. I have an object (class in C++) named LanguageManager, it 
opens the selected .pdb database y it's ready to receive requests, like "give 
me the message for exiting the application in the current selected language", 
like this:

const char* msg = languageManager.getMessage(lmApplicationExiting);

The LanguageManager object loads (queries) the record with index 
lmApplicationExiting (it is in the enumeration), convert it to a string and 
returns it.

Finally, I can program a desktop application to help the user to translate o 
build an language text file and convert it to a .pdb file...


-Jeisson
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to