In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, a locale is a set of
parameter
A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
s that defines the user's language, region and any special variant preferences that the user wants to see in their
user interface
In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
. Usually a locale identifier consists of at least a language code and a country/region code.
Locale is an important aspect of
i18n
In computing, internationalization and localization (American) or internationalisation and localisation (British English), often abbreviated i18n and L10n, are means of adapting computer software to different languages, regional peculiarities and ...
.
General locale settings
These settings usually include the following display (output) format settings:
* Number format setting
* Character classification, case conversion settings
* Date-time format setting
* String
collation
Collation is the assembly of written information into a standard order. Many systems of collation are based on numerical order or alphabetical order, or extensions and combinations thereof. Collation is a fundamental element of most office fil ...
setting
* Currency format setting
* Paper size setting
* Color setting
The locale settings are about formatting output given a locale. So, the time zone information and daylight saving time are not usually part of the locale settings.
Less usual is the input format setting, which is mostly defined on a per application basis.
Programming and markup language support
In these environments,
*
C
*
C++
*
Eiffel
Eiffel may refer to:
Places
* Eiffel Peak, a summit in Alberta, Canada
* Champ de Mars – Tour Eiffel station, Paris, France; a transit station
Structures
* Eiffel Tower, in Paris, France, designed by Gustave Eiffel
* Eiffel Bridge, Ungheni, ...
*
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
*
.NET Framework
The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
*
REBOL
*
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
*
Perl
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
*
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
*
Python
*
XML
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. ...
*
JSP
*
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
and other (nowadays)
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
-based environments, they are defined in a format similar to
BCP 47
An IETF BCP 47 language tag is a standardized code or tag that is used to identify human languages in the Internet. The tag structure has been standardized by the Internet Engineering Task Force (IETF) in ''Best Current Practice (BCP) 47''; the su ...
. They are usually defined with just
ISO 639
ISO 639 is a set of standards by the International Organization for Standardization that is concerned with representation of names for languages and language groups.
It was also the name of the original standard, approved in 1967 (as ''ISO 639/ ...
(language) and
ISO 3166-1 alpha-2
ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special are ...
(2-letter country) codes.
POSIX platforms
On
POSIX
The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming inte ...
platforms such as
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
,
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
and others, locale identifiers are defined by
ISO/IEC 15897
ISO/IEC 15897 (''Procedures for the registration of cultural elements'') is an ISO/ IEC standard for the registration of new POSIX locales and POSIX charmaps. This standard is the result of a "fast-track" adoption of CEN ENV 12005, a European p ...
, which is similar to the
BCP 47
An IETF BCP 47 language tag is a standardized code or tag that is used to identify human languages in the Internet. The tag structure has been standardized by the Internet Engineering Task Force (IETF) in ''Best Current Practice (BCP) 47''; the su ...
definition of language tags, but the locale variant modifier is defined differently, and the
character set
Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values tha ...
is included as a part of the identifier. It is defined in this format: . (For example,
Australian English using the
UTF-8
UTF-8 is a variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit''.
UTF-8 is capable of ...
encoding is .)
In the next example there is an output of command
locale
for
Czech language
Czech (; Czech ), historically also Bohemian (; ''lingua Bohemica'' in Latin), is a West Slavic language of the Czech–Slovak group, written in Latin script. Spoken by over 10 million people, it serves as the official language of the Czech ...
(cs),
Czech Republic
The Czech Republic, or simply Czechia, is a landlocked country in Central Europe. Historically known as Bohemia, it is bordered by Austria to the south, Germany to the west, Poland to the northeast, and Slovakia to the southeast. Th ...
(CZ) with explicit
UTF-8
UTF-8 is a variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit''.
UTF-8 is capable of ...
encoding:
$ locale
LANG=cs_CZ.UTF-8
LC_CTYPE="cs_CZ.UTF-8"
LC_NUMERIC="cs_CZ.UTF-8"
LC_TIME="cs_CZ.UTF-8"
LC_COLLATE="cs_CZ.UTF-8"
LC_MONETARY="cs_CZ.UTF-8"
LC_MESSAGES="cs_CZ.UTF-8"
LC_PAPER="cs_CZ.UTF-8"
LC_NAME="cs_CZ.UTF-8"
LC_ADDRESS="cs_CZ.UTF-8"
LC_TELEPHONE="cs_CZ.UTF-8"
LC_MEASUREMENT="cs_CZ.UTF-8"
LC_IDENTIFICATION="cs_CZ.UTF-8"
LC_ALL=
Specifics for Microsoft platforms
Windows uses specifi
languagean
territorystrings.
The ''locale identifier'' (LCID) for
unmanaged code on
Microsoft Windows is a number such as 1033 for English (United States) or 1041 for Japanese (Japan). These numbers consist of a language code (lower 10 bits) and a culture code (upper bits), and are therefore often written in
hexadecimal
In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, h ...
notation, such as 0x0409 or 0x0411.
Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
is starting to introduce managed code
application programming interfaces (APIs) for .NET that use this format. One of the first to be generally released is a function to mitigate issues with
internationalized domain name
An internationalized domain name (IDN) is an Internet domain name that contains at least one label displayed in software applications, in whole or in part, in non-latin script or alphabet, such as Arabic, Bengali, Chinese (Mandarin, simplifie ...
s,
but more are in
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, which was released five years before, at the time being the longest time span between successive releases of ...
Beta 1.
Starting with Windows Vista, new functions
that use
BCP 47
An IETF BCP 47 language tag is a standardized code or tag that is used to identify human languages in the Internet. The tag structure has been standardized by the Internet Engineering Task Force (IETF) in ''Best Current Practice (BCP) 47''; the su ...
locale names have been introduced to replace nearly all LCID-based APIs.
See also
*
Internationalization and localization
In computing, internationalization and localization ( American) or internationalisation and localisation (British English), often abbreviated i18n and L10n, are means of adapting computer software to different languages, regional peculiarities an ...
*
ISO 639
ISO 639 is a set of standards by the International Organization for Standardization that is concerned with representation of names for languages and language groups.
It was also the name of the original standard, approved in 1967 (as ''ISO 639/ ...
language code
A language code is a code that assigns letters or numbers as identifiers or classifiers for languages. These codes may be used to organize library collections or presentations of data, to choose the correct localizations and translations in compu ...
s
*
ISO 3166-1 alpha-2
ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special are ...
region codes
*
ISO 15924
ISO 15924, ''Codes for the representation of names of scripts'', is an international standard defining codes for writing systems or ''scripts'' (a "set of graphic characters used for the written form of one or more languages"). Each script is give ...
script code
ISO 15924, ''Codes for the representation of names of scripts'', is an international standard defining codes for writing systems or ''scripts'' (a "set of graphic characters used for the written form of one or more languages"). Each script is give ...
s
*
IETF language tag
An IETF BCP 47 language tag is a standardized code or tag that is used to identify human languages in the Internet. The tag structure has been standardized by the Internet Engineering Task Force (IETF) in ''Best Current Practice (BCP) 47''; the s ...
*
C localization functions
In computing, C localization functions are a group of functions in the C programming language implementing basic localization routines. The functions are used in multilingual programs to adapt to the specific locale. In particular, the way of dis ...
*
CCSID
A CCSID (coded character set identifier) is a 16-bit number that represents a particular character encoding, encoding of a specific code page. For example, Unicode is a code page that has several encoding (so called "transformation") forms, like UT ...
*
Code page
In computing, a code page is a character encoding and as such it is a specific association of a set of printable characters and control characters with unique numbers. Typically each number represents the binary value in a single byte. (In some c ...
*
Common Locale Data Repository
The Common Locale Data Repository Project, often abbreviated as CLDR, is a project of the Unicode Consortium to provide locale data in XML format for use in computer applications. CLDR contains locale-specific information that an operating sys ...
*
Date and time representation by country
Different conventions exist around the world for date and time representation, both written and spoken.
Differences
Differences can exist in:
*The calendar that is used.
*The order in which the year, month, and day are represented. (Year-mo ...
*
AppLocale AppLocale is a tool for Windows XP and Windows Server 2003 by Microsoft. It is a launcher application that makes it possible to run non-Unicode (code page-based) applications in a locale of the user's choice. Since changing the locale normally requ ...
References
External links
BCP 47Language Subtag RegistryCommon Locale Data Repository* {{Javadoc:SE, package=java.util, java/util, Locale
Javadoc
Javadoc (originally cased JavaDoc) is a documentation generator created by Sun Microsystems for the Java language (now owned by Oracle Corporation) for generating API documentation in HTML format from Java source code. The HTML format is used ...
API documentation
Locale and Language information from MicrosoftMS-LCID: Windows Language Code Identifier (LCID) Reference from MicrosoftMicrosoft LCID listMicrosoft LCID chart with decimal equivalentsICU Locale ExplorerDebian Wiki on Locales* Article
by
Nathan C. Myers
Nathan or Natan may refer to:
People
*Nathan (given name), including a list of people and characters with this name
*Nathan (surname)
*Nathan (prophet), a person in the Hebrew Bible
*Nathan (son of David), biblical figure, son of King David and ...
locale(7): Description of multi-language support- Linux man page
Sort order charts for various operating system locales and database collationsNATSPEC Library*
ttp://docs.translatehouse.org/projects/localization-guide/en/latest/guide/start.html?id=guide/start#locales Guides to locales and locale creation on various platforms
Unix user management and support-related utilities
Unix SUS2008 utilities
Internationalization and localization