Does anyone implement subject (localization of program to different language)? If yes, then how? What is the best way of doing it?
I have done it in a commercial project. Rather than using string resources, we built an external file with ALL the strings of the program (well, all that are language dependant, anyway). The file used to build the binary localization file is a very simple one. You have lines like "number=string". This file is parsed into a a format that has a header (number of strings, size of raw string data), followed by a table of (string length, string offset), and then the all the strings, null-terminated, in one big block. The entries are sorted by ID number before writing to file. At loadtime, the file is loaded directly into memory, and the offsets in the table is added with the base of the allocated memory block, and thus they become directly usable pointers. When you want to use a string runtime, just call the "string" function (or whatever you want to call it), passing along an ID number, and you can use the resultant string directly (read-only!). Since the string IDs are sorted, you can use a nice and efficient binary search (divide and conquer).
I tried to implement something like this, and it worked pretty well. But there is also another question: how to keep dialogs (created before compilation) translated without re-compilation?:confused:
I've never done it, but I have seen programs with different resource DLLs for each language and just load the one you need. All the resource IDs should be equal between the resource files. bitRAKE
"Developing International Software" Nadine Kano Microsoft Press C 1995 ISBN 1-55615-840-8 Available at Amazon.com Pretty decent book, I bought for future reference. As it's now out of print, you can find it at 2nd sellers like I did, for 7 bucks. This message was edited by Ernie, on 3/1/2001 5:02:22 PM