Class WinNT.LocaleMacros
- Enclosing interface:
- WinNT
A language ID is a 16 bit value which 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
WARNING: This pattern isn't always follows, Serbina, Bosnian & Croation for example.
It is recommended that applications test for locale names or actual LCIDs.
Note that the LANG, SUBLANG construction is not always consistent. The named locale APIs (eg GetLocaleInfoEx) are recommended.
Language IDs do not exist for all locales
A locale ID is a 32 bit value which is the combination of a language ID, a sort ID, and a reserved area. The bits are allocated as follows:
+-------------+---------+-------------------------+ | Reserved | Sort ID | Language ID | +-------------+---------+-------------------------+ 31 20 19 16 15 0 bit
WARNING: This pattern isn't always followed (es-ES_tradnl vs es-ES for example)
It is recommended that applications test for locale names or actual LCIDs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final int
LANGIDFROMLCID
(WinDef.LCID lcid) extract the language id from a locale id.static final int
MAKELANGID
(int p, int s) Construct language id from a primary language id and a sublanguage id.static final WinDef.LCID
MAKELCID
(int lgid, int srtid) construct the locale id from a language id and a sort id.static final WinDef.LCID
MAKESORTLCID
(int lgid, int srtid, int ver) construct the locale id from a language id, sort id, and sort version.static final int
PRIMARYLANGID
(int lgid) Extract primary language id from a language id.static final int
SORTIDFROMLCID
(WinDef.LCID lcid) extract the sort id from a locale id.static final int
extract the sort version from a locale id.static final int
SUBLANGID
(int lgid) Extract sublanguage id from a language id.
-
Constructor Details
-
LocaleMacros
public LocaleMacros()
-
-
Method Details
-
MAKELCID
construct the locale id from a language id and a sort id.- Parameters:
lgid
- language idsrtid
- sort id- Returns:
- locale id derived from ldig and srtid
-
MAKESORTLCID
construct the locale id from a language id, sort id, and sort version.- Parameters:
lgid
- locale idsrtid
- sort idver
- sort version- Returns:
- locale id derviced from a language id, sort id, and sort version.
-
LANGIDFROMLCID
extract the language id from a locale id.- Parameters:
lcid
- locale id- Returns:
- extracted language id
-
SORTIDFROMLCID
extract the sort id from a locale id.- Parameters:
lcid
- locale id- Returns:
- extracted sort id
-
SORTVERSIONFROMLCID
extract the sort version from a locale id.- Parameters:
lcid
- locale id- Returns:
- extracted sort version
-
MAKELANGID
public static final int MAKELANGID(int p, int s) Construct language id from a primary language id and a sublanguage id.- Parameters:
p
- primary language IDs
- sublanguage ID- Returns:
- constructed language id
-
PRIMARYLANGID
public static final int PRIMARYLANGID(int lgid) Extract primary language id from a language id.- Parameters:
lgid
- language ID- Returns:
- extracted primary language id
-
SUBLANGID
public static final int SUBLANGID(int lgid) Extract sublanguage id from a language id.- Parameters:
lgid
- language ID- Returns:
- extracted sublanguage id
-