public static final class WinNT.LocaleMacros
extends java.lang.Object
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 and Description |
---|
LocaleMacros() |
Modifier and Type | Method and Description |
---|---|
static int |
LANGIDFROMLCID(WinDef.LCID lcid)
extract the language id from a locale id.
|
static int |
MAKELANGID(int p,
int s)
Construct language id from a primary language id and a sublanguage id.
|
static WinDef.LCID |
MAKELCID(int lgid,
int srtid)
construct the locale id from a language id and a sort id.
|
static WinDef.LCID |
MAKESORTLCID(int lgid,
int srtid,
int ver)
construct the locale id from a language id, sort id, and sort version.
|
static int |
PRIMARYLANGID(int lgid)
Extract primary language id from a language id.
|
static int |
SORTIDFROMLCID(WinDef.LCID lcid)
extract the sort id from a locale id.
|
static int |
SORTVERSIONFROMLCID(WinDef.LCID lcid)
extract the sort version from a locale id.
|
static int |
SUBLANGID(int lgid)
Extract sublanguage id from a language id.
|
public static final WinDef.LCID MAKELCID(int lgid, int srtid)
lgid
- language idsrtid
- sort idpublic static final WinDef.LCID MAKESORTLCID(int lgid, int srtid, int ver)
lgid
- locale idsrtid
- sort idver
- sort versionpublic static final int LANGIDFROMLCID(WinDef.LCID lcid)
lcid
- locale idpublic static final int SORTIDFROMLCID(WinDef.LCID lcid)
lcid
- locale idpublic static final int SORTVERSIONFROMLCID(WinDef.LCID lcid)
lcid
- locale idpublic static final int MAKELANGID(int p, int s)
p
- primary language IDs
- sublanguage IDpublic static final int PRIMARYLANGID(int lgid)
lgid
- language IDpublic static final int SUBLANGID(int lgid)
lgid
- language ID