Format for LANGUAGE Statement in .RES Files

Last reviewed: November 2, 1995
Article ID: Q89822
The information in this article applies to:

- Microsoft Win32 SDK, versions 3.1, 3.5, 3.51, and 4.0

SUMMARY

The syntax for the LANGUAGE statement in the resource script file is given as follows on page 289 of the Win32 SDK "Tools User's Guide" manual:

   LANGUAGE major, minor

   major
      Language identifier. Must be one of the constants from WINNLS.H

   minor
      Sublanguage identifier. Must be one of the constants from WINNLS.H

For example, suppose that you want to set the language for the resources in a file to French. For the major parameter, you would choose the following constant from the list of language identifiers

   #define LANG_FRENCH                  0x0c

and you would have the choice of any of the sublanguages that begin with SUBLANG_FRENCH in the list of sublanguage identifiers. They are:

   #define SUBLANG_FRENCH               0x01
   #define SUBLANG_FRENCH_BELGIAN       0x02
   #define SUBLANG_FRENCH_CANADIAN      0x03
   #define SUBLANG_FRENCH_SWISS         0x04

RC.EXE does not directly place these constants in the .RES file. It uses the macro MAKELANGID to turn the parameters into a WORD that corresponds to a language ID.

NOTE: The following three combinations have special meaning:

Primary language ID   Sublanguage ID       Meaning
LANG_NEUTRAL          SUBLANG_NEUTRAL      Language neutral
LANG_NEUTRAL          SUBLANG_DEFAULT      User default language
LANG_NEUTRAL          SUBLANG_SYS_DEFAULT  System default language

MORE INFORMATION

The following information is taken from the WINNLS.H file.

   A language ID is a 16-bit value that is the combination of a
   primary language ID and a secondary language ID.  The bits are
   allocated as follows:

      +-----------------------+-------------------------+
      |      Sublanguage ID   |   Primary Language ID   |
      +-----------------------+-------------------------+
       15                   10 9                       0   bit

   Language ID creation/extraction macros:

      MAKELANGID    - Construct language ID from primary language ID and
                      sublanguage ID.
      PRIMARYLANGID - Extract primary language ID from a language ID.
      SUBLANGID     - Extract sublanguage ID from a language ID.

The macros are defined as follows

   #define MAKELANGID(p, s)       ((((USHORT)(s)) << 10) | (USHORT)(p))
   #define PRIMARYLANGID(lgid)    ((USHORT)(lgid) & 0x3ff)
   #define SUBLANGID(lgid)        ((USHORT)(lgid) >> 10)


Additional reference words: 3.10 3.50 4.00 95
KBCategory: kbtool
KBSubcategory: TlsRc


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: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.