Locale
object represents a specific geographical, political,
or cultural region. An operation that requires a Locale
to perform
its task is called locale-sensitive and uses the Locale
to tailor information for the user. For example, displaying a number
is a locale-sensitive operation— the number should be formatted
according to the customs and conventions of the user's native country,
region, or culture.
The Locale
class implements IETF BCP 47 which is composed of
RFC 4647 "Matching of Language
Tags" and RFC 5646 "Tags
for Identifying Languages" with support for the LDML (UTS#35, "Unicode
Locale Data Markup Language") BCP 47-compatible extensions for locale data
exchange.
A Locale
object logically consists of the fields
described below.
Locale
always canonicalizes to lower case.[a-zA-Z]{2,8}
. Note that this is not the full
BCP47 language production, since it excludes extlang. They are
not needed since modern three-letter language codes replace
them.Locale
always canonicalizes to title case (the first
letter is upper case and the rest of the letters are lower
case).[a-zA-Z]{4}
Locale
always canonicalizes to upper case.[a-zA-Z]{2} | [0-9]{3}
Locale
. Where there are two or more variant values
each indicating its own semantics, these values should be ordered
by importance, with most important first, separated by
underscore('_'). The variant field is case sensitive.However, the variant field in Locale
has
historically been used for any kind of variation, not just
language variations. For example, some supported variants
available in Java SE Runtime Environments indicate alternative
cultural behaviors such as calendar type or number script. In
BCP 47 this kind of information, which does not identify the
language, is supported by extension subtags or private use
subtags.
SUBTAG
(('_'|'-') SUBTAG)*
where SUBTAG =
[0-9][0-9a-zA-Z]{3} | [0-9a-zA-Z]{5,8}
. (Note: BCP 47 only
uses hyphen ('-') as a delimiter, this is more lenient).Locale
implement the semantics and syntax of BCP 47
extension subtags and private use subtags. The extensions are
case insensitive, but Locale
canonicalizes all
extension keys and values to lower case. Note that extensions
cannot have empty values.[0-9a-zA-Z]
. Well-formed values have the form
SUBTAG ('-' SUBTAG)*
where for the key 'x'
SUBTAG = [0-9a-zA-Z]{1,8}
and for other keys
SUBTAG = [0-9a-zA-Z]{2,8}
(that is, 'x' allows
single-character subtags).Note
Although BCP 47 requires field values to be registered
in the IANA Language Subtag Registry, the Locale
class
does not provide any validation features. The Builder
only checks if an individual field satisfies the syntactic
requirement (is well-formed), but does not validate the value
itself. See Builder
for details.
UTS#35, "Unicode Locale Data Markup Language" defines optional attributes and keywords to override or refine the default behavior associated with a locale. A keyword is represented by a pair of key and type. For example, "nu-thai" indicates that Thai local digits (value:"thai") should be used for formatting numbers (key:"nu").
The keywords are mapped to a BCP 47 extension value using the
extension key 'u' (UNICODE_LOCALE_EXTENSION
). The above
example, "nu-thai", becomes the extension "u-nu-thai".
Thus, when a Locale
object contains Unicode locale
attributes and keywords,
getExtension(UNICODE_LOCALE_EXTENSION)
will return a
String representing this information, for example, "nu-thai". The
Locale
class also provides getUnicodeLocaleAttributes
, getUnicodeLocaleKeys
, and
getUnicodeLocaleType
which allow you to access Unicode
locale attributes and key/type pairs directly. When represented as
a string, the Unicode Locale Extension lists attributes
alphabetically, followed by key/type sequences with keys listed
alphabetically (the order of subtags comprising a key's type is
fixed when the type is defined)
A well-formed locale key has the form
[0-9a-zA-Z]{2}
. A well-formed locale type has the
form "" | [0-9a-zA-Z]{3,8} ('-' [0-9a-zA-Z]{3,8})*
(it
can be empty, or a series of subtags 3-8 alphanums in length). A
well-formed locale attribute has the form
[0-9a-zA-Z]{3,8}
(it is a single subtag with the same
form as a locale type subtag).
The Unicode locale extension specifies optional behavior in locale-sensitive services. Although the LDML specification defines various keys and values, actual locale-sensitive service implementations in a Java Runtime Environment might not support any particular Unicode locale attributes or key/type pairs.
There are several ways to obtain a Locale
object.
Using Builder
you can construct a Locale
object
that conforms to BCP 47 syntax.
The method forLanguageTag
obtains a Locale
object for a well-formed BCP 47 language tag. The method
of(String, String, String)
and its overloads obtain a
Locale
object from given language
, country
,
and/or variant
defined above.
The Locale
class provides a number of convenient constants
that you can use to obtain Locale
objects for commonly used
locales. For example, Locale.US
is the Locale
object
for the United States.
The default Locale is provided for any locale-sensitive methods if no
Locale
is explicitly specified as an argument, such as
DateFormat#getInstance()
. The default Locale is determined at startup
of the Java runtime and established in the following three phases:
user.language
) may
not have values from the host environment.
Locale-related System Properties Key | Description |
---|---|
user.language |
language for the default Locale,
such as "en" (English) |
user.script |
script for the default Locale,
such as "Latn" (Latin) |
user.country |
country for the default Locale,
such as "US" (United States) |
user.variant |
variant for the default Locale,
such as "POSIX" |
user.extensions |
extensions for the default Locale,
such as "u-ca-japanese" (Japanese Calendar) |
user.extensions
property
is unparsable, it is ignored. The overriding values of other properties are not
checked for syntax or validity and are used directly in the default Locale.
(Typically, system property values can be provided using the -D
command-line
option of a launcher. For example, specifying -Duser.extensions=foobarbaz
results in a default Locale with no extensions, while specifying
-Duser.language=foobarbaz
results in a default Locale whose language is
"foobarbaz".)
Locale
instance is constructed from the values of these
system properties.
Altering the system property values with System#setProperties(Properties)
/
System#setProperty(String, String)
has no effect on the default Locale.
Once the default Locale is established, applications can query the default
Locale with getDefault()
and change it with setDefault(Locale)
.
If the default Locale is changed with setDefault(Locale)
, the corresponding
system properties are not altered. It is not recommended that applications read
these system properties and parse or interpret them as their values may be out of date.
There are finer-grained default Locales specific for each Locale.
.
These category specific default Locales can be queried by getDefault(Category)
,
and set by setDefault(Category, Locale)
. Construction of these category
specific default Locales are determined by the corresponding system properties,
which consist of the base system properties as listed above, suffixed by either
".display"
or ".format"
depending on the category. For example,
the value of the user.language.display
system property will be used in the
language
part of the default Locale for the Locale.
category. In the absence of category specific system properties, the "category-less"
system properties are used, such as user.language
in the previous example.
If an application or a system is internationalized and provides localized resources for multiple locales, it sometimes needs to find one or more locales (or language tags) which meet each user's specific preferences. Note that a term "language tag" is used interchangeably with "locale" in this locale matching documentation.
In order to do matching a user's preferred locales to a set of language tags, RFC 4647 Matching of Language Tags defines two mechanisms: filtering and lookup. Filtering is used to get all matching locales, whereas lookup is to choose the best matching locale. Matching is done case-insensitively. These matching mechanisms are described in the following sections.
A user's preference is called a Language Priority List and is
expressed as a list of language ranges. There are syntactically two types of
language ranges: basic and extended. See
Locale.
for details.
The filtering operation returns all matching language tags. It is defined in RFC 4647 as follows: "In filtering, each language range represents the least specific language tag (that is, the language tag with fewest number of subtags) that is an acceptable match. All of the language tags in the matching set of tags will have an equal or greater number of subtags than the language range. Every non-wildcard subtag in the language range will appear in every one of the matching language tags."
There are two types of filtering: filtering for basic language ranges
(called "basic filtering") and filtering for extended language ranges
(called "extended filtering"). They may return different results by what
kind of language ranges are included in the given Language Priority List.
Locale.
is a parameter to specify how filtering should
be done.
The lookup operation returns the best matching language tags. It is defined in RFC 4647 as follows: "By contrast with filtering, each language range represents the most specific tag that is an acceptable match. The first matching tag found, according to the user's priority, is considered the closest match and is the item returned."
For example, if a Language Priority List consists of two language ranges,
"zh-Hant-TW"
and "en-US"
, in prioritized order, lookup
method progressively searches the language tags below in order to find the
best matching language tag.
If there is a language tag which matches completely to a language range above, the language tag is returned.1. zh-Hant-TW 2. zh-Hant 3. zh 4. en-US 5. en
"*"
is the special language range, and it is ignored in lookup.
If multiple language tags match as a result of the subtag '*'
included in a language range, the first matching language tag returned by
an Iterator
over a Collection
of language tags is treated as
the best matching one.
Once you've obtained a Locale
you can query it for information
about itself. Use getCountry
to get the country (or region)
code and getLanguage
to get the language code.
You can use getDisplayCountry
to get the
name of the country suitable for displaying to the user. Similarly,
you can use getDisplayLanguage
to get the name of
the language suitable for displaying to the user. Interestingly,
the getDisplayXXX
methods are themselves locale-sensitive
and have two versions: one that uses the default
DISPLAY
locale and one
that uses the locale specified as an argument.
The Java Platform provides a number of classes that perform locale-sensitive
operations. For example, the NumberFormat
class formats
numbers, currency, and percentages in a locale-sensitive manner. Classes
such as NumberFormat
have several convenience methods
for creating a default object of that type. For example, the
NumberFormat
class provides these three convenience methods
for creating a default NumberFormat
object:
NumberFormat.getInstance(); NumberFormat.getCurrencyInstance(); NumberFormat.getPercentInstance();
FORMAT
locale:
NumberFormat.getInstance(myLocale); NumberFormat.getCurrencyInstance(myLocale); NumberFormat.getPercentInstance(myLocale);
Locale
is the mechanism for identifying the kind of object
(NumberFormat
) that you would like to get. The locale is
just a mechanism for identifying objects,
not a container for the objects themselves.
In order to maintain compatibility, Locale's
constructors retain their behavior prior to the Java Runtime
Environment version 1.7. The same is largely true for the
toString
method. Thus Locale objects can continue to
be used as they were. In particular, clients who parse the output
of toString into language, country, and variant fields can continue
to do so (although this is strongly discouraged), although the
variant field will have additional information in it if script or
extensions are present.
In addition, BCP 47 imposes syntax restrictions that are not
imposed by Locale's constructors. This means that conversions
between some Locales and BCP 47 language tags cannot be made without
losing information. Thus toLanguageTag
cannot
represent the state of locales whose language, country, or variant
do not conform to BCP 47.
Because of these issues, it is recommended that clients migrate
away from constructing non-conforming locales and use the
forLanguageTag
and Locale.Builder
APIs instead.
Clients desiring a string representation of the complete locale can
then always rely on toLanguageTag
for this purpose.
For compatibility reasons, two
non-conforming locales are treated as special cases. These are
ja_JP_JP
and th_TH_TH
. These are ill-formed
in BCP 47 since the variants are too short. To ease migration to BCP 47,
these are treated specially during construction. These two cases (and only
these) cause a constructor to generate an extension, all other values behave
exactly as they did prior to Java 7.
Java has used ja_JP_JP
to represent Japanese as used in
Japan together with the Japanese Imperial calendar. This is now
representable using a Unicode locale extension, by specifying the
Unicode locale key ca
(for "calendar") and type
japanese
. When the Locale constructor is called with the
arguments "ja", "JP", "JP", the extension "u-ca-japanese" is
automatically added.
Java has used th_TH_TH
to represent Thai as used in
Thailand together with Thai digits. This is also now representable using
a Unicode locale extension, by specifying the Unicode locale key
nu
(for "number") and value thai
. When the Locale
constructor is called with the arguments "th", "TH", "TH", the
extension "u-nu-thai" is automatically added.
During serialization, writeObject writes all fields to the output stream, including extensions.
During deserialization, readResolve adds extensions as described in Special Cases, only for the two cases th_TH_TH and ja_JP_JP.
Locale's constructor has always converted three language codes to
their earlier, obsoleted forms: he
maps to iw
,
yi
maps to ji
, and id
maps to
in
. Since Java SE 17, this is no longer the case. Each
language maps to its new form; iw
maps to he
, ji
maps to yi
, and in
maps to id
.
For the backward compatible behavior, the system property
java.locale.useOldISOCodes
reverts the behavior
back to that of before Java SE 17. If the system property is set to
true
, those three current language codes are mapped to their
backward compatible forms. The property is only read at Java runtime
startup and subsequent calls to System.setProperty()
will
have no effect.
The APIs added in 1.7 map between the old and new language codes,
maintaining the mapped codes internal to Locale (so that
getLanguage
and toString
reflect the mapped
code, which depends on the java.locale.useOldISOCodes
system
property), but using the new codes in the BCP 47 language tag APIs (so
that toLanguageTag
reflects the new one). This
preserves the equivalence between Locales no matter which code or
API is used to construct them. Java's default resource bundle
lookup mechanism also implements this mapping, so that resources
can be named using either convention, see ResourceBundle.
.
The Locale constructors have always specified that the language and the country param be two characters in length, although in practice they have accepted any length. The specification has now been relaxed to allow language codes of two to eight characters and country (region) codes of two to three characters, and in particular, three-letter language codes and three-digit region codes as specified in the IANA Language Subtag Registry. For compatibility, the implementation still does not impose a length constraint.
Builder
, ResourceBundle
, java.text.Format
, java.text.NumberFormat
, java.text.Collator
Modifier and Type | Class and Description |
---|---|
public static class | Locale.
|
public static enum | Locale.
Enum for locale categories. |
public static enum | Locale.
This enum provides constants to select a filtering mode for locale matching. |
public static enum | Locale.
Enum for specifying the type defined in ISO 3166. |
public static class | Locale.
This class expresses a Language Range defined in RFC 4647 Matching of Language Tags. |
private static class | |
private static class | Locale.
Obtains a localized locale names from a LocaleNameProvider implementation. |
Modifier and Type | Field and Description |
---|---|
private transient BaseLocale | |
public static final Locale | CANADA
Useful constant for country. |
public static final Locale | CANADA_FRENCH
Useful constant for country. |
public static final Locale | CHINA
Useful constant for country. |
public static final Locale | CHINESE
Useful constant for language. |
private static final Map | |
private static volatile Locale | |
private static volatile Locale | |
private static volatile Locale | |
private static final int | |
private static final int | DISPLAY_LANGUAGE
Display types for retrieving localized names from the name providers. |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
public static final Locale | ENGLISH
Useful constant for language. |
public static final Locale | FRANCE
Useful constant for country. |
public static final Locale | FRENCH
Useful constant for language. |
public static final Locale | GERMAN
Useful constant for language. |
public static final Locale | GERMANY
Useful constant for country. |
private transient int | hashCodeValue
Calculated hashcode |
private static volatile String[] | |
private static volatile String[] | |
public static final Locale | ITALIAN
Useful constant for language. |
public static final Locale | ITALY
Useful constant for country. |
public static final Locale | JAPAN
Useful constant for country. |
public static final Locale | JAPANESE
Useful constant for language. |
public static final Locale | KOREA
Useful constant for country. |
public static final Locale | KOREAN
Useful constant for language. |
private transient volatile String | |
private static final ReferencedKeyMap | |
private static final Function | |
private transient LocaleExtensions | |
public static final Locale | PRC
Useful constant for country. |
public static final char | PRIVATE_USE_EXTENSION
The key for the private use extension ('x'). |
public static final Locale | ROOT
Useful constant for the root locale. |
private static final ObjectStreamField[] | |
pack-priv static final long | serialVersionUID
serialization ID |
public static final Locale | SIMPLIFIED_CHINESE
Useful constant for language. |
public static final Locale | TAIWAN
Useful constant for country. |
public static final Locale | TRADITIONAL_CHINESE
Useful constant for language. |
public static final Locale | UK
Useful constant for country. |
public static final char | UNICODE_LOCALE_EXTENSION
The key for Unicode locale extension ('u'). |
public static final Locale | US
Useful constant for country. |
Access | Constructor and Description |
---|---|
private | Locale(BaseLocale baseLocale, LocaleExtensions extensions)
Private constructor used by getInstance method |
public | Locale(String
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
up to 8 characters in length. See the language, String Locale class description about
valid language values.An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code.
See the country, String Locale class description about valid country values.Any arbitrary value used to indicate a variation of a variant)Locale .
See the Locale class description for the details.
Deprecated
since 19. Locale constructors have been deprecated. See Obtaining a Locale for other options.
Construct a locale from language, country and variant. |
public | Locale(String
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
up to 8 characters in length. See the language, String Locale class description about
valid language values.An ISO 3166 alpha-2 country code or a UN M.49 numeric-3 area code.
See the country)Locale class description about valid country values.
Deprecated
since 19. Locale constructors have been deprecated. See Obtaining a Locale for other options.
Construct a locale from language and country. |
public | Locale(String
An ISO 639 alpha-2 or alpha-3 language code, or a language subtag
up to 8 characters in length. See the language)Locale class description about
valid language values.
Deprecated
since 19. Locale constructors have been deprecated. See Obtaining a Locale for other options.
Construct a locale from a language code. |
Modifier and Type | Method and Description |
---|---|
public static Stream | |
public static String | Returns: a case folded IETF BCP 47 language tagthe IETF BCP 47 language tag. languageTag)Returns a case folded IETF BCP 47 language tag. |
public Object | |
private static String | |
private static Locale | createConstant(byte baseType)
This method must be called only for creating the Locale.* constants due to making shortcuts. |
public boolean | Returns: true if this Locale is equal to the specified object.the reference object with which to compare. obj)Overrides java. Returns true if this Locale is equal to another object. |
public static List | Returns: a list ofLocale instances for matching language tags
sorted in descending order based on priority or weight, or an empty
list if nothing matches. The list is modifiable.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,Locale instances used for matchingfiltering mode modeReturns a list of matching |
public static List | Returns: a list ofLocale instances for matching language tags
sorted in descending order based on priority or weight, or an empty
list if nothing matches. The list is modifiable.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,Locale instances used for matchingReturns a list of matching |
public static List | Returns: a list of matching language tags sorted in descending order based on priority or weight, or an empty list if nothing matches. The list is modifiable.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,language tags tags, Locale.filtering mode modeReturns a list of matching languages tags using the basic filtering mechanism defined in RFC 4647. |
public static List | Returns: a list of matching language tags sorted in descending order based on priority or weight, or an empty list if nothing matches. The list is modifiable.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,language tags tags)Returns a list of matching languages tags using the basic filtering mechanism defined in RFC 4647. |
public static Locale | Returns: The locale that best represents the language tag.the language tag languageTag)Returns a locale for the specified IETF BCP 47 language tag string. |
private static String | Returns: a string representing the list.the list of strings to be formatted.
and formatting them into a list. stringList, String should take 2 arguments for reduction pattern)Format a list using given pattern strings. |
public static Locale[] | |
pack-priv BaseLocale | Returns: base locale of this LocalePackage locale method returning the Locale's BaseLocale, used by ResourceBundle |
private static LocaleExtensions | |
public String | Returns: The country/region code, or the empty string if none is defined.Returns the country/region code for this locale, which should either be the empty string, an uppercase ISO 3166 2-letter code, or a UN M.49 3-digit code. |
public static Locale | Returns: the default locale for this instance of the Java Virtual MachineGets the current value of the |
public static Locale | Returns: the default locale for the specified Category for this instance of the Java Virtual Machinethe specified category to get the default locale categoryGets the current value of the |
private static Optional | |
public final String | Returns: The name of the country appropriate to the locale.Returns a name for the locale's country that is appropriate for display to the user. |
public String | Returns: The name of the country appropriate to the given locale.The locale for which to retrieve the display country. inLocale)Returns a name for the locale's country that is appropriate for display to the user. |
private String | |
public final String | Returns: The name of the display language.Returns a name for the locale's language that is appropriate for display to the user. |
public String | Returns: The name of the display language appropriate to the given locale.The locale for which to retrieve the display language. inLocale)Returns a name for the locale's language that is appropriate for display to the user. |
private static synchronized Locale | |
public final String | Returns: The name of the locale appropriate to display.Returns a name for the locale that is appropriate for display to the user. |
public String | Returns: The name of the locale appropriate to display.The locale for which to retrieve the display name. inLocale)Returns a name for the locale that is appropriate for display to the user. |
public String | Returns: the display name of the script code for the current defaultDISPLAY localeReturns a name for the locale's script that is appropriate for display to the user. |
public String | Returns: the display name of the script code for the current defaultDISPLAY localeThe locale for which to retrieve the display script. inLocale)Returns a name for the locale's script that is appropriate for display to the user. |
private String | |
public final String | Returns: The name of the display variant code appropriate to the locale.Returns a name for the locale's variant code that is appropriate for display to the user. |
public String | Returns: The name of the display variant code appropriate to the given locale.The locale for which to retrieve the display variant code. inLocale)Returns a name for the locale's variant code that is appropriate for display to the user. |
private String[] | Returns: an array of display names, possible of zero length.The locale for which to retrieve the display variant. inLocale)Return an array of the display names of the variant. |
public String | Returns: The extension, or null if this locale defines no extension for the specified key.the extension key key)Returns the extension (or private use) value associated with the specified key, or null if there is no extension associated with the key. |
public Set | Returns: The set of extension keys, or the empty set if this locale has no extensions.Returns the set of extension keys associated with this locale, or the empty set if it has no extensions. |
private static synchronized Locale | |
pack-priv static Locale | Returns: theLocale instance requestedlowercase 2 to 8 language code. language, String uppercase two-letter ISO-3166 code and numeric-3 UN M.49 area code. country, String vendor and browser specific code. See class description. variant)Returns a |
pack-priv static Locale | getInstance(String language, String script, String country, String variant, LocaleExtensions extensions)
|
pack-priv static Locale | |
private static String[] | |
private static String | |
public String | Returns: a three-letter abbreviation of this locale's countryReturns a three-letter abbreviation of this locale's country. |
public String | Returns: a three-letter abbreviation of this locale's languageReturns a three-letter abbreviation of this locale's language. |
public static String[] | Returns: An array of ISO 3166 two-letter country codes.Returns a list of all 2-letter country codes defined in ISO 3166. |
public static Set | Returns: aSet of ISO3166 country codes for the specified typeLocale. specified ISO code type.Returns a |
public static String[] | Returns: An array of ISO 639 two-letter language codes.Returns a list of all 2-letter language codes defined in ISO 639. |
public String | Returns: The language code, or the empty string if none is defined.Returns the language code of this Locale. |
pack-priv LocaleExtensions | Returns: locale extensions of this Locale, ornull if no extensions are definedPackage private method returning the Locale's LocaleExtensions, used by ResourceBundle. |
public String | Returns: The script code, or the empty string if none is defined.Returns the script for this locale, which should either be the empty string or an ISO 15924 4-letter script code. |
public Set | Returns: The set of attributes.Returns the set of unicode locale attributes associated with this locale, or the empty set if it has no attributes. |
public Set | Returns: The set of Unicode locale keys, or the empty set if this locale has no Unicode locale keywords.Returns the set of Unicode locale keys defined by this locale, or the empty set if this locale has none. |
public String | Returns: The Unicode locale type associated with the key, or null if the locale does not define the key.the Unicode locale key key)Returns the Unicode locale type associated with the specified Unicode locale key for this locale. |
public String | Returns: The variant code, or the empty string if none is defined.Returns the variant code for this locale. |
public boolean | Returns: true if this Locale has any extensionsReturns |
public int | |
private static Locale | |
private static Locale | |
private static boolean | |
public static Locale | Returns: the best matchingLocale instance chosen based on
priority or weight, or null if nothing matches.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,Locale instances used for matchingReturns a |
public static String | Returns: the best matching language tag chosen based on priority or weight, ornull if nothing matches.user's Language Priority List in which each language
tag is sorted in descending order based on priority or weight priorityList,language tags used for matching tags)Returns the best-matching language tag using the lookup mechanism defined in RFC 4647. |
public static Locale | Returns: ALocale objectA language code. See the language, String Locale class description of
language values.A country code. See the country, String Locale class description of
country values.Any arbitrary value used to indicate a variation of a variant)Locale .
See the Locale class description of variant values.Obtains a locale from language, country and variant. |
public static Locale | |
public static Locale | |
private void | |
private Object | Returns: an instance ofLocale equivalent to
the deserialized Locale .Returns a cached |
public static synchronized void | setDefault(Locale
the new default locale newLocale)Sets the |
public static synchronized void | setDefault(Locale.
the specified category to set the default locale category,the new default locale newLocale)Sets the |
public Locale | Returns: a copy of thisLocale with no extensions, or this
if this has no extensionsReturns a copy of this |
public String | Returns: a BCP47 language tag representing the localeReturns a well-formed IETF BCP 47 language tag representing this locale. |
public final String | Returns: A string representation of the Locale, for debugging.Overrides java. Returns a string representation of this language + "_" + country + "_" + (variant + "_#" | "#") + script + "_" + extensions |
private void | writeObject(ObjectOutputStream
the out)ObjectOutputStream to writeSerializes this |