My program needs to be in many languages and the language would be chosen right when the prog is run. So what would be the best way to do this? A sepearate file for all the strings and different files for different languages?
Posted on 2001-03-07 23:52:00 by Elecon
Microsoft has spent conciderable time and effort in providing "local" language programs. In fact, they earn more money off non-english editions of their software then english. You may compile a single resource file for strings in several languages, and pull out the one matching the current language with the FormatMessage API. FindResourceEx also takes a language ID. There are many ways provided to skin this cat. MS documents this process in "Developing International Software." While I just bought a copy (7 bucks at a 2nd bookseller), it is out of print. I have an ebook verion on my MSDN CD, it is also online in MSDN.
Posted on 2001-03-08 00:19:00 by Ernie
Elecon, If you have to have a large number of different language strings, using a resource file if probably not the best way to do it unless you don't mind having a very large resource section in your file. I would recommend using a set of seperate language files in text format and reading the language your user selects on startup after the selection dialog box. Thsi means more than one file but it would be a lot easier to manage. Regards, hutch@pbq.com.au
Posted on 2001-03-08 09:37:00 by hutch--
Thanks for the ideas, I'm not sure how many languages or how many strings there are going to be yet so I'm not sure which way I'm going to go. But if I decide to use seperate files, I would assume that I would read the whole file at the start when the language is selected, but how would I reference to a string in the file when it would be in a different place depending on the language?
Posted on 2001-03-08 19:38:00 by elecon
Start reading thru "Developing International Software." Really, it has all those answers. Every thread has language information stored so you can know what language the user expects to see. You can tap that and spec a single resource ID number PLUS a language ID and come back with the proper string.
Posted on 2001-03-08 19:46:00 by Ernie