Hello! I am looking for a good way to make an application multilingual.
Danish/English for now (but I don't want to preclude more than two languages
eventually) Every dialog will have an option for changing language (except
simple dialog boxes)
Here is what I am envisioning - I want to make sure I am on the right track:
There is a global language object which handles giving out strings, has
functions for setting/retrieving the current language and giving an array of
all available languages (in string format).
All the strings are contained in a giant hashtable and have string
references. Strings are accessed like this (this is an example only):
STable["SUREDELETE?"]
If the current language is english this could return the string "Are you
sure that you want to delete this file?"
I'm planning to embed all the strings into the program (a giant function
which contains all the strings and populates the string table on first
use) - so they could be easily edited, and avoid having to access strings
from an outside file. This is a small application, so I am not too woried
about the size of the function.
Every form would have an "updatecomponents" function which would set the
text of all affected components to their respective language.
I still need a way to trigger this updatecomponents if the language is
changed in another window, particularly if I will be making use of modeless
dialogs keeping language a global setting. Maybe windows message? (Better
ideas?)
Does this system for handling changing languages sound good?
Oh BTW - I am using Visual Studio 2003, if that makes any difference.
--
LTP
:)