Lingobit Localizer - Software Localization ToolTools for software Localization DE | DA | FR | ES | IT | JA | NL | PL | PT | RU | TR | ZH
Software Localization

Lingobit Home > Solutions

Localization using satellite DLLs in MFC 7.0

Starting with MFC 7.0 Microsoft introduces new enhanced support for resource-only DLLs

Lingobit Localizer make it easy to localize MFC application and to create resource-only DLLs. Starting with version 7.0 (Visual Studio 2003), MFC automatically loads translated satellite DLLs, making your application multilingual with no effort.

How it works

When the application begins executing, MFC automatically loads the localized resource most appropriate for the environment. For example, you could have an application with English language resources with two satellite DLLs, one containing a French translation of your resources and the other containing a German translation. When the application is run on an English language system, it uses the English resources. If run on a French system, it uses the French resources; if run on a German system, it uses the German resources.

Satellite DLLs must be named using ApplicationNameXXX.dll pattern, where ApplicationName is the name of the .exe or .dll using MFC, and XXX is the three-letter code for the language of the resources (for example, 'ENU' or 'DEU'). MFC attempts to load the resource DLL for each of the following languages in order, stopping when it finds one:

  1. (Windows 2000 or later) The current user's default UI language, as returned from the GetUserDefaultUILanguage().
  2. (Windows 2000 or later) The current user's default UI language, without any specific sublanguage (that is, Canadian English becomes U.S. English).
  3. The system's default UI language. On Windows 2000 or higher, this is returned from the GetSystemDefaultUILanguage(). On other platforms, this is the language of the OS itself.
  4. The system's default UI language, without any specific sublanguage.
  5. A "fake" language with the 3-letter code LOC.

If MFC does not find any satellite DLLs, it uses whatever resources are contained in the application itself.

As an example, suppose that an application FileName.exe uses MFC and is running on a Windows 2000 multiple user-interface system; the system UI language is U.S. English and the current user's UI language is set to Canadian French. MFC will look for the following DLLs in the following order:

  1. FileNameFRC.dll (user's UI language).
  2. FileNameFRA.dll (user's UI language without the sublanguage, in this example French (France).
  3. FileNameENU.dll (system's UI language).
  4. FileNameLOC.dll.

If none of these DLLs are found, MFC will just use the resources in FileName.exe.

You can find more information here.