Thread: Pocket Weather
View Single Post
  #27 (permalink)  
Old 11-21-2008, 01:51 AM
digitaldon37 digitaldon37 is offline
Basic4ppc Veteran
 
Join Date: Jan 2008
Posts: 215
Default Language Support

Quote:
In my programs I use simple text files. I have a language index, depending on the selected language, and load the right file.
The file content is loaded into a Text array and in the program I use these varaibles with their index instead of direct text like.
Label1.Text = text(11) instead of
Label1.Text = "File:"
In the text files the 11th entry is for example "File:", "Fichier:" "Datei:" and so on depending on the language.
The possible languages are predefined and if the file for the given language does exist, the choose is enabled or disabled. To add a new language file the user can translate one of the existing files and change the last letter. The predefined languages in my programs are:
English, French, German, Italian, Spanish, Portuguese, Russian and Japanese. The Japanese translations came from alfcen. See attached picture.
For example for the DynSim (Dynamic Simulations) program there are the files, DynSimE.txt, DynSimF.txt, DynSimD.txt and DynSimI.txt, the others don't exist yet. The last letter gives the language.
E English, F French, D German, I Italian, S Spanish, P Portuguese, R Russian and J Japanese.

I have also help files, in different languages, for some of my programs, but less than for the text files. If, for a given language the text file does exist but not the help file, the english version is loaded by default.

The language index is saved in an Init file (Ex: DynSim.ini), that is always saved when leaving the program and loaded at start up so the user gets the last setup.

Best regards.
Thanks! That would be great since you've already got those routines. I am not making any changes at the moment so please use the latest source in post #1 (25.1) and then we'll use that as the next release.
Reply With Quote