views:

241

answers:

1

OK, so we're writing our MFC application to make use of the built-in localization support with satellite DLL's since MFC 7. Everything seem to be working fine, except that my Windows 7 Enterprise Edition install with MUI support and using a Swedish UI instead of an English UI still displays the English UI in our application.

The application uses Swedish as its default language, with an English localization DLL in the form AppNameENU.dll, so MFC is actually intentionally switching to English language under these circumstances, as if it's not caring for the user choice in the MUI-enabled Windows OS, and only the default shipping language of the Windows install?

From the MSDN page on this (the link above), I read it as MFC should actually take these settings into account though, but I'm not 100% sure. Can someone please clarify?

+3  A: 

It's because the MFC support for language selection has a design bug: It will decide to load resources from the exe only if no DLL match user OR system language.

In your case: It sets up its (ordered) list of languages as such:

  1. Swedish (User language)
  2. English (System language)

Then it looks up your DLLs (Bug: only the dlls, not the exe!): No match for Swedish. But there's a match for English!

Solution: Use my CLanguageSupport class. It works fine even in your use case.

Feel free to use it. You'll need only a couple of minutes to incorporate it into your app and it uses the exact same DLL scheme as the one you already implemented. (Hint: Don't forget the step where you must get rid of the CWinApp::InitInstance() call!)

In addition, if you are interested (this is optional), you can get an automatic languages menu to let user pick his own preference in case the default is not what he wants.

And if you're looking for a great tool to help you manage your translations, think appTranslator ;-)

HTH,

Serge - appTranslator
Thanks! I'll definitely take a look at your class then! And yes, we've actually already looked at appTranslator a bit. ;-) We may have to restort to it due to our accumulating masses of string resources and lack of oversight in the horrible Visual Studio UI. :S
Jonas