Home

locale

Locale refers to a set of parameters that define the linguistic, cultural, and regional conventions used by a software application or by a user. In computing, a locale identifies preferences such as language, country/region, and character encoding, and may include a variant. Locales influence formatting of dates, times, numbers, currencies, and collation order, as well as translation of user interface strings. They enable software to present information in a familiar form for a given audience and to process input according to local rules.

Locale identifiers typically combine components. Common forms include language and region, for example en_US (English as

Locales are supported by standard libraries and frameworks; for example, the Java Locale class, Python's locale

Data underpinning locales come from internationalization efforts such as the Common Locale Data Repository and the

used
in
the
United
States),
fr_FR,
or
es_MX.
Some
systems
also
include
a
character
encoding
(such
as
.UTF-8)
or
modifiers
(like
@currency=EUR).
POSIX-style
locales
use
codes
like
language[_territory][.codeset][@modifier],
while
Windows
uses
language
culture
identifiers
(LCID).
module,
and
ICU
provide
data
for
formatting
and
sorting
according
to
locale.
Web
servers
may
derive
locale
from
the
Accept-Language
header,
while
operating
systems
expose
environment
variables
such
as
LANG
or
LC_ALL.
Unicode
CLDR.
Locale
data
are
not
universal:
a
given
system
may
lack
a
requested
locale
and
fall
back
to
a
default.
Distinguish
locale
from
location:
a
locale
is
about
conventions,
not
geography
alone.