Re: Bast way to internationalize app with dlls

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> I want to be able to change the language of the application on the fly.
If "on the fly" means "when the user does the selection and without starting
the application", then it is a bit messy. You have to update all the windows
that are alredy created.
It the functionality is not really "MUST", an restarting the application
is acceptable, then you save a lot of work. In fact, the amount of work
can be so big, that it is not worth it if the feature is just "nice to have".


> In the past, when I only had a single exe, I just created several
> resource-only dlls and used AfxSetResourceHandle(). However, now that
> I have broken functionality into additional code dlls, things are
> more complicated.
True. But there is no reason not to use the same aproach.
This is what MS Windows and Office use for MUI

> 1) What is a good architecture to handle language resources in this
> situation. I want to leave the English resources as part of the original
> exe/dlls. I am thinking creating a separate folder for each language and
> putting in the matching resource dll for each exe/code dll.
Separate folders is the nice way to go. This is (again) what MS does with
MUI. And you can use the same structure for other localizable content
(Help, Templates, Samples, etc.)

> 2) I need to be able to change language on the fly. How do I specify the
> laguage to use by all (e.g. what mfc/win32 functions)?
You can store it in registry or an ini file, then "announce" all DLLs to
update.

> 3) The code dlls may need to display resources from the app (e.g. common
> message strings).
Changed to display from the app resource DLL.

> 4) The app may need to display resources from the static and dynamic dlls
> (e.g. strings, graphics).
I am not sure I understant the problem.

> Note: Currently the dlls are all regular MFC dlls. I can change to MFC
> Extension DLLs, if it would be easier.
It is not easier. Regular DLLs is just fine.


--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
.


Quantcast