HOWTO: Write Multiple-Language Resources

ID: Q89866

The information in this article applies to:

SUMMARY

When you are writing multiple-language resources, the dialog box identifiers need to be identical for each language instance, as demonstrated below.

   #define DialogID       100

   DialogID DIALOG  0, 0, 210, 10
   LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
   .
   .
   .
   DialogID DIALOG  0, 0, 210, 10
   LANGUAGE LANG_FRENCH,SUBLANG_FRENCH

The FindResource() application programming interface (API) function is used by the system to fetch the dialog box. FindResource() gets the locale information for the process, then attempts to fetch the resource with that language identifier using FindResourceEx(), the language-specific API function for fetching resources. If FindResourceEx() fails to load the language-specific dialog box, FindResource() then attempts to load the neutral dialog box, which should fetch LANG_FRENCH,SUBLANG_FRENCH, if the locale is SUBLANG_FRENCH_CAN or similar.

The LANGUAGE identifiers and the VERSIONINFO language identifiers should also be identical. The code page for resources is always the Unicode code page. The system will translate from Unicode to the required code page.

The preferred method of developing multiple-language resources is to include a LANGUAGE statement for each language supported rather than using the CODEPAGE, LANGUAGE identifier, and VERSIONINFO information. Although the CODEPAGE information will work, the new method is easier to use.

Additional query words:

Keywords          : kbIntlDev 
Issue type        : kbhowto

Last Reviewed: December 31, 1998