Home

LANGID

LANGID stands for language identifier, a 16-bit value used by Windows and related APIs to designate a language and its locale for user interfaces and resources. It encodes two pieces of information: a primary language ID in the high byte and a sublanguage ID in the low byte. LANGIDs can be composed with the MAKELANGID macro by supplying a primary language and a sublanguage. They provide a compact way to refer to a language variant; for example, English (United States) is 0x0409, French (France) is 0x040C, Spanish (Spain) 0x040A, and German (Germany) 0x0407.

LANGID is commonly used by Windows functions such as GetUserDefaultLangID, GetSystemDefaultLangID, SetThreadLocale, and GetLocaleInfo to select

Windows resources, such as satellite DLLs and string tables, are organized by language IDs. At runtime, the

Background and scope: LANGID values derive from a combination of ISO language codes for the primary language,

resources,
fonts,
and
formatting
appropriate
for
the
user’s
language.
It
is
distinct
from
and
not
the
same
as
an
LCID
(locale
identifier),
which
is
a
broader
32-bit
value
that
also
encodes
sort
order
and
cultural
conventions;
LCIDs
historically
combined
language,
region,
and
additional
rules.
system
attempts
to
load
resources
that
match
the
thread
or
user
LANGID
and
may
fall
back
to
a
neutral
language
if
an
exact
match
is
unavailable.
This
mechanism
supports
multilingual
user
interfaces
without
requiring
separate
code
paths
for
every
language.
augmented
by
Windows-specific
sublanguage
identifiers.
They
remain
in
use
for
backward
compatibility
in
modern
Windows
APIs
and
libraries,
providing
a
stable,
compact
means
of
language
identification
in
software
localization.