Supporting Multiple Languages in a Single Application

Last reviewed: January 15, 1998
Article ID: Q130057
3.10 WINDOWS kbother

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SUMMARY

It is not trivial to support multiple languages in a single Windows-based application. Unlike Windows NT, Windows has no built-in support for different language versions of a single resource.

MORE INFORMATION

The easiest way to do it and the way it is done for Windows itself and all our localized Windows-based applications, is to have separate executables for each language (English, German, French, and so on) version.

However, it is possible to create a single executable that supports multiple language resources. For example, you could have a separate DLL containing the resources for different language versions of your application. You can link a specific version of DLL in runtime.

The language selection should be an install-time option, because there is no official way to identify the host language. The application needs to ask the user to confirm what the application has found.

All the messages and system errors generated by Windows, regardless of your resource files, will displayed as the local language error messages.

If an application needs to have one resource file, the developer must create a unique resource ID for each language version of the resource, and then load the appropriate resource depending on the language. For example, the following string table could be created:

   IDS_HELLO_ENGLISH, "Hello"
   IDS_HELLO_GERMAN, "Hallo"

The application would then either load the English string or the German string as required.

There is no documentation on this subject because it is not a feature of Windows. There is a new book out that has a chapter on internationalizing applications. It is written in a friendly manner. Microsoft Windows 3.1 Developer's Workshop by Dr. John Butler; it's published by Microsoft Press. In addition, the Microsoft Developer Relations Group is currently revising "The International Handbook."


Additional reference words: 3.10 localization international foreign kbinf
KBCategory: kbother
KBSubcategory: KBIntlDev


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.