Software Archive
Read-only legacy content
17060 Discussions

Language versions of Dialogs

Intel_C_Intel
Employee
533 Views
It is possible to make a copy of a Dialog with a different language form the original. How to call it from the program? Is it necesary to change the name in the Editor? Where to find information?
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
533 Views
There are several approaches.

a) Right click on a dialog in ResourceView and select "Insert Copy". Change the language and edit the copy appropriately. In this way, Windows will select appropriate version during execution based on system locale. However, this wasn't quite applicable in my case since many Serbian users simply keep English locale as default.

b) Insert copy as before, but define a symbol in "Condition" box for each version, say, ENGLISH and PORTUGUESE. In Project/Settings/Resources/Preprocessor definitions, type the corresponding constant. (It's also convenient to define two separate project configurations in Build/Configurations/Add which will differ only for that constant). In this way, you get two versions of exe, one for each language. However, if number of languages grows, maintenance becomes quite inconvenient.

c) In our last setup, we keep all language-specific resources in resource-only dlls, which contain identical sets but for different languages. Each dll links only .rc file (and a tiny .f90 containing only DllEntryPoint). The appropriate dll is loaded using LoadLibrary and each call to DlgInit specifies also handle of the dll. Further, each dll contains string table for texts that appear outside dialogs and they are loaded using LoadString (more precisely, there's a wrapper module which does it in a more convenient manner). In this way, there's one exe version (which contains no language-dependent string literals at all) and several dlls -- now we can even change language in run-time.

Jugoslav
0 Kudos
Intel_C_Intel
Employee
533 Views
Thank you Mr. Dujic
Although the approach c is very elegant and useful, because it is possible to change language in run time, I will try first approach a) because it seems to be straight and easy.
Thank you again
OPiedrahita
0 Kudos
Reply