- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page