com.ibm.icu.util
Class ULocale
java.lang.Object
com.ibm.icu.util.ULocale
- All Implemented Interfaces:
- Serializable
Deprecated. This is a draft API and might change in a future release of ICU.
- public final class ULocale
- extends Object
- implements Serializable
A class analogous to Locale
that provides additional
support for ICU protocol. In ICU 3.0 this class is enhanced to support
RFC 3066 language identifiers.
Many classes and services in ICU follow a factory idiom, in
which a factory method or object responds to a client request with
an object. The request includes a locale (the requested
locale), and the returned object is constructed using data for that
locale. The system may lack data for the requested locale, in
which case the locale fallback mechanism will be invoked until a
populated locale is found (the valid locale). Furthermore,
even when a populated locale is found (the valid locale),
further fallback may be required to reach a locale containing the
specific data required by the service (the actual locale).
ULocale performs 'normalization' and 'canonicalization' of locale ids.
Normalization 'cleans up' ICU locale ids as follows:
- language, script, country, variant, and keywords are properly cased
(lower, title, upper, upper, and lower case respectively)
- hyphens used as separators are converted to underscores
- three-letter language and country ids are converted to two-letter
equivalents where available
- surrounding spaces are removed from keywords and values
- if there are multiple keywords, they are put in sorted order
Canonicalization additionally performs the following:
- POSIX ids are converted to ICU format IDs
- 'grandfathered' 3066 ids are converted to ICU standard form
- 'PREEURO' and 'EURO' variants are converted to currency keyword form, with the currency
id appropriate to the country of the locale (for PREEURO) or EUR (for EURO).
All ULocale constructors automatically normalize the locale id. To handle
POSIX ids, canonicalize
can be called to convert the id
to canonical form, or the canonicalInstance
factory method
can be called.
This class provides selectors VALID_LOCALE
and ACTUAL_LOCALE
intended for use in methods named
getLocale(). These methods exist in several ICU classes,
including Calendar
, Currency
, UFormat
,
BreakIterator
, Collator
, DateFormatSymbols
, and DecimalFormatSymbols
and their subclasses, if
any. Once an object of one of these classes has been created,
getLocale() may be called on it to determine the valid and
actual locale arrived at during the object's construction.
Note: The getLocale() method will be implemented in ICU
3.0; ICU 2.8 contains a partial preview implementation. The
actual locale is returned correctly, but the valid
locale is not, in most cases.
- Author:
- weiv, Alan Liu, Ram Viswanadha
- See Also:
Locale
,
Serialized Form- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
Nested Class Summary |
static class |
ULocale.Type
Deprecated. This is a draft API and might change in a future release of ICU. |
Field Summary |
static ULocale.Type |
ACTUAL_LOCALE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
CANADA
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
CANADA_FRENCH
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
CHINA
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
CHINESE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
ENGLISH
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
FRANCE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
FRENCH
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
GERMAN
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
GERMANY
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
ITALIAN
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
ITALY
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
JAPAN
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
JAPANESE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
KOREA
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
KOREAN
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
PRC
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
ROOT
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
SIMPLIFIED_CHINESE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
TAIWAN
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
TRADITIONAL_CHINESE
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
UK
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
US
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale.Type |
VALID_LOCALE
Deprecated. This is a draft API and might change in a future release of ICU. |
Constructor Summary |
ULocale(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
ULocale(String a,
String b,
String c)
Deprecated. This is a draft API and might change in a future release of ICU. |
Method Summary |
static String |
canonicalize(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
Object |
clone()
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
createCanonical(String nonCanonicalID)
Deprecated. This is a draft API and might change in a future release of ICU. |
boolean |
equals(Object obj)
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
forLocale(Locale loc)
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale[] |
getAvailableLocales()
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getBaseName()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getBaseName(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getCountry()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getCountry(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static ULocale |
getDefault()
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayCountry()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayCountry(String localeID,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayCountry(String localeID,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayCountry(ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayKeyword(String keyword)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayKeyword(String keyword,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayKeyword(String keyword,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayKeywordValue(String keyword)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayKeywordValue(String localeID,
String keyword,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayKeywordValue(String localeID,
String keyword,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayKeywordValue(String keyword,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayLanguage()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayLanguage(String localeID,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayLanguage(String localeID,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayLanguage(ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayName()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayName(String localeID,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayName(String localeID,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayName(ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayScript()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayScript(String localeID,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayScript(String localeID,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayScript(ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayVariant()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayVariant(String localeID,
String displayLocaleID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getDisplayVariant(String localeID,
ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getDisplayVariant(ULocale displayLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
ULocale |
getFallback()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getFallback(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getISO3Country()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getISO3Country(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getISO3Language()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getISO3Language(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String[] |
getISOCountries()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String[] |
getISOLanguages()
Deprecated. This is a draft API and might change in a future release of ICU. |
Iterator |
getKeywords()
Deprecated. This is a draft API and might change in a future release of ICU. |
static Iterator |
getKeywords(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getKeywordValue(String keywordName)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getKeywordValue(String localeID,
String keywordName)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getLanguage()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getLanguage(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getName()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getName(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getScript()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getScript(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
getVariant()
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
getVariant(String localeID)
Deprecated. This is a draft API and might change in a future release of ICU. |
int |
hashCode()
Deprecated. This is a draft API and might change in a future release of ICU. |
static void |
setDefault(ULocale newLocale)
Deprecated. This is a draft API and might change in a future release of ICU. |
ULocale |
setKeywordValue(String keyword,
String value)
Deprecated. This is a draft API and might change in a future release of ICU. |
static String |
setKeywordValue(String localeID,
String keyword,
String value)
Deprecated. This is a draft API and might change in a future release of ICU. |
Locale |
toLocale()
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
toString()
Deprecated. This is a draft API and might change in a future release of ICU. |
ENGLISH
public static final ULocale ENGLISH
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
FRENCH
public static final ULocale FRENCH
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
GERMAN
public static final ULocale GERMAN
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ITALIAN
public static final ULocale ITALIAN
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
JAPANESE
public static final ULocale JAPANESE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
KOREAN
public static final ULocale KOREAN
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
CHINESE
public static final ULocale CHINESE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
SIMPLIFIED_CHINESE
public static final ULocale SIMPLIFIED_CHINESE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
TRADITIONAL_CHINESE
public static final ULocale TRADITIONAL_CHINESE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for language.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
FRANCE
public static final ULocale FRANCE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
GERMANY
public static final ULocale GERMANY
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ITALY
public static final ULocale ITALY
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
JAPAN
public static final ULocale JAPAN
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
KOREA
public static final ULocale KOREA
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
CHINA
public static final ULocale CHINA
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
PRC
public static final ULocale PRC
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
TAIWAN
public static final ULocale TAIWAN
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
UK
public static final ULocale UK
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
US
public static final ULocale US
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
CANADA
public static final ULocale CANADA
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
CANADA_FRENCH
public static final ULocale CANADA_FRENCH
- Deprecated. This is a draft API and might change in a future release of ICU.
- Useful constant for country/region.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ROOT
public static final ULocale ROOT
- Deprecated. This is a draft API and might change in a future release of ICU.
- The root ULocale.
- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ACTUAL_LOCALE
public static ULocale.Type ACTUAL_LOCALE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Selector for getLocale() indicating the locale of the
resource containing the data. This is always at or above the
valid locale. If the valid locale does not contain the
specific data being requested, then the actual locale will be
above the valid locale. If the object was not constructed from
locale data, then the valid locale is null.
- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
VALID_LOCALE
public static ULocale.Type VALID_LOCALE
- Deprecated. This is a draft API and might change in a future release of ICU.
- Selector for getLocale() indicating the most specific
locale for which any data exists. This is always at or above
the requested locale, and at or below the actual locale. If
the requested locale does not correspond to any resource data,
then the valid locale will be above the requested locale. If
the object was not constructed from locale data, then the
actual locale is null.
Note: The valid locale will be returned correctly in ICU
3.0 or later. In ICU 2.8, it is not returned correctly.
- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ULocale
public ULocale(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Construct a ULocale from a RFC 3066 locale ID. The locale ID consists
of optional language, script, country, and variant fields in that order,
separated by underscores, followed by an optional keyword list. The
script, if present, is four characters long-- this distinguishes it
from a country code, which is two characters long. Other fields
are distinguished by position as indicated by the underscores. The
start of the keyword list is indicated by '@', and consists of one
or more keyword/value pairs separated by commas.
This constructor not canonicalize the localeID.
- Parameters:
localeID
- string representation of the locale, e.g:
"en_US", "sy_Cyrl_YU", "zh__pinyin", "es_ES@currency=EUR,collation=traditional"- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
ULocale
public ULocale(String a,
String b,
String c)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Construct a ULocale from a localeID constructed from the three 'fields' a, b, and c. These
fields are concatenated using underscores to form a localeID of
the form a_b_c, which is then handled like the localeID passed
to
ULocale(String localeID)
.
Java locale strings consisting of language, country, and
variant will be handled by this form, since the country code
(being shorter than four letters long) will not be interpreted
as a script code. If a script code is present, the final
argument ('c') will be interpreted as the country code. It is
recommended that this constructor only be used to ease porting,
and that clients instead use the single-argument constructor
when constructing a ULocale from a localeID.
- Parameters:
a
- first component of the locale idb
- second component of the locale idc
- third component of the locale id- See Also:
ULocale(String)
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
forLocale
public static ULocale forLocale(Locale loc)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Return a ULocale object for a
Locale
.
The ULocale is canonicalized.
- Parameters:
loc
- a JDK locale- Status:
- Draft ICU 3.2.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
createCanonical
public static ULocale createCanonical(String nonCanonicalID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Create a ULocale from the id by first canonicalizing the id.
- Parameters:
nonCanonicalID
- the locale id to canonicalize
- Returns:
- the locale created from the canonical version of the ID.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
toLocale
public Locale toLocale()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Convert this ULocale object to a
Locale
.
- Returns:
- a JDK locale that either exactly represents this object
or is the closest approximation.
- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDefault
public static ULocale getDefault()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the current default ULocale.
- Status:
- Draft ICU 2.8.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
setDefault
public static void setDefault(ULocale newLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Sets the default ULocale. This also sets the default Locale.
If the caller does not have write permission to the
user.language property, a security exception will be thrown,
and the default ULocale will remain unchanged.
- Parameters:
newLocale
- the new default locale
- Throws:
SecurityException
- if a security manager exists and its
checkPermission
method doesn't allow the operation.
NullPointerException
- if newLocale
is null- See Also:
SecurityManager.checkPermission(java.security.Permission)
,
PropertyPermission
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
clone
public Object clone()
- Deprecated. This is a draft API and might change in a future release of ICU.
- This is for compatibility with Locale-- in actuality, since ULocale is
immutable, there is no reason to clone it, so this API returns 'this'.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
hashCode
public int hashCode()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the hashCode.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
equals
public boolean equals(Object obj)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns true if the other object is another ULocale with the
same full name, or is a String localeID that matches the full name.
Note that since names are not canonicalized, two ULocales that
function identically might not compare equal.
- Returns:
- true if this Locale is equal to the specified object.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getAvailableLocales
public static ULocale[] getAvailableLocales()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a list of all installed locales.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISOCountries
public static String[] getISOCountries()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a list of all 2-letter country codes defined in ISO 3166.
Can be used to create Locales.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISOLanguages
public static String[] getISOLanguages()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a list of all 2-letter language codes defined in ISO 639.
Can be used to create Locales.
[NOTE: ISO 639 is not a stable standard-- some languages' codes have changed.
The list this function returns includes both the new and the old codes for the
languages whose codes have changed.]
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getLanguage
public String getLanguage()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the language code for this locale, which will either be the empty string
or a lowercase ISO 639 code.
- See Also:
getDisplayLanguage()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getLanguage
public static String getLanguage(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the language code for the locale ID,
which will either be the empty string
or a lowercase ISO 639 code.
- See Also:
getDisplayLanguage()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getScript
public String getScript()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the script code for this locale, which might be the empty string.
- See Also:
getDisplayScript()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getScript
public static String getScript(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the script code for the specified locale, which might be the empty string.
- See Also:
getDisplayScript()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getCountry
public String getCountry()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the country/region code for this locale, which will either be the empty string
or an uppercase ISO 3166 2-letter code.
- See Also:
getDisplayCountry()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getCountry
public static String getCountry(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the country/region code for this locale, which will either be the empty string
or an uppercase ISO 3166 2-letter code.
- Parameters:
localeID
- - See Also:
getDisplayCountry()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getVariant
public String getVariant()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the variant code for this locale, which might be the empty string.
- See Also:
getDisplayVariant()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getVariant
public static String getVariant(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the variant code for the specified locale, which might be the empty string.
- See Also:
getDisplayVariant()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getFallback
public static String getFallback(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the fallback locale for the specified locale, which might be the empty string.
- Status:
- Draft ICU 3.2.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getFallback
public ULocale getFallback()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the fallback locale for this locale. If this locale is root, returns null.
- Status:
- Draft ICU 3.2.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getBaseName
public String getBaseName()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the (normalized) base name for this locale.
- Returns:
- the base name as a String.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getBaseName
public static String getBaseName(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the (normalized) base name for the specified locale.
- Parameters:
localeID
- the locale ID as a string
- Returns:
- the base name as a String.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getName
public String getName()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the (normalized) full name for this locale.
- Returns:
- String the full name of the localeID
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getName
public static String getName(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the (normalized) full name for the specified locale.
- Parameters:
localeID
- the localeID as a string
- Returns:
- String the full name of the localeID
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
toString
public String toString()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a string representation of this object.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getKeywords
public Iterator getKeywords()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns an iterator over keywords for this locale. If there
are no keywords, returns null.
- Returns:
- iterator over keywords, or null if there are no keywords.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getKeywords
public static Iterator getKeywords(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns an iterator over keywords for the specified locale. If there
are no keywords, returns null.
- Returns:
- an iterator over the keywords in the specified locale, or null
if there are no keywords.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getKeywordValue
public String getKeywordValue(String keywordName)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the value for a keyword in this locale. If the keyword is not defined, returns null.
- Parameters:
keywordName
- name of the keyword whose value is desired. Case insensitive.
- Returns:
- the value of the keyword, or null.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getKeywordValue
public static String getKeywordValue(String localeID,
String keywordName)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the value for a keyword in the specified locale. If the keyword is not defined, returns null.
The locale name does not need to be normalized.
- Parameters:
keywordName
- name of the keyword whose value is desired. Case insensitive.
- Returns:
- String the value of the keyword as a string
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
canonicalize
public static String canonicalize(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the canonical name for the specified locale ID. This is used to convert POSIX
and other grandfathered IDs to standard ICU form.
- Parameters:
localeID
- the locale id
- Returns:
- the canonicalized id
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
setKeywordValue
public ULocale setKeywordValue(String keyword,
String value)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Given a keyword and a value, return a new locale with an updated
keyword and value. If keyword is null, this removes all keywords from the locale id.
Otherwise, if the value is null, this removes the value for this keyword from the
locale id. Otherwise, this adds/replaces the value for this keyword in the locale id.
The keyword and value must not be empty.
- Parameters:
keyword
- the keyword to add/remove, or null to remove all keywords.value
- the value to add/set, or null to remove this particular keyword.
- Returns:
- the updated locale
- Status:
- Draft ICU 3.2.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
setKeywordValue
public static String setKeywordValue(String localeID,
String keyword,
String value)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Given a locale id, a keyword, and a value, return a new locale id with an updated
keyword and value. If keyword is null, this removes all keywords from the locale id.
Otherwise, if the value is null, this removes the value for this keyword from the
locale id. Otherwise, this adds/replaces the value for this keyword in the locale id.
The keyword and value must not be empty.
- Parameters:
localeID
- the locale id to modifykeyword
- the keyword to add/remove, or null to remove all keywords.value
- the value to add/set, or null to remove this particular keyword.
- Returns:
- the updated locale id
- Status:
- Draft ICU 3.2.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISO3Language
public String getISO3Language()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a three-letter abbreviation for this locale's language. If the locale
doesn't specify a language, returns the empty string. Otherwise, returns
a lowercase ISO 639-2/T language code.
The ISO 639-2 language codes can be found on-line at
ftp://dkuug.dk/i18n/iso-639-2.txt
- Throws:
MissingResourceException
- Throws MissingResourceException if the
three-letter language abbreviation is not available for this locale.- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISO3Language
public static String getISO3Language(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a three-letter abbreviation for this locale's language. If the locale
doesn't specify a language, returns the empty string. Otherwise, returns
a lowercase ISO 639-2/T language code.
The ISO 639-2 language codes can be found on-line at
ftp://dkuug.dk/i18n/iso-639-2.txt
- Throws:
MissingResourceException
- Throws MissingResourceException if the
three-letter language abbreviation is not available for this locale.- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISO3Country
public String getISO3Country()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a three-letter abbreviation for this locale's country/region. If the locale
doesn't specify a country, returns the empty string. Otherwise, returns
an uppercase ISO 3166 3-letter country code.
- Throws:
MissingResourceException
- Throws MissingResourceException if the
three-letter country abbreviation is not available for this locale.- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getISO3Country
public static String getISO3Country(String localeID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a three-letter abbreviation for this locale's country/region. If the locale
doesn't specify a country, returns the empty string. Otherwise, returns
an uppercase ISO 3166 3-letter country code.
- Throws:
MissingResourceException
- Throws MissingResourceException if the
three-letter country abbreviation is not available for this locale.- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayLanguage
public String getDisplayLanguage()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's language localized for display in the default locale.
- Returns:
- the localized language name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayLanguage
public String getDisplayLanguage(ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's language localized for display in the provided locale.
- Parameters:
displayLocale
- the locale in which to display the name.
- Returns:
- the localized language name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayLanguage
public static String getDisplayLanguage(String localeID,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's language localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose language will be displayeddisplayLocaleID
- the id of the locale in which to display the name.
- Returns:
- the localized language name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayLanguage
public static String getDisplayLanguage(String localeID,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's language localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose language will be displayed.displayLocale
- the locale in which to display the name.
- Returns:
- the localized language name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayScript
public String getDisplayScript()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's script localized for display in the default locale.
- Returns:
- the localized script name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayScript
public String getDisplayScript(ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's script localized for display in the provided locale.
- Parameters:
displayLocale
- the locale in which to display the name.
- Returns:
- the localized script name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayScript
public static String getDisplayScript(String localeID,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's script localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose script will be displayeddisplayLocaleID
- the id of the locale in which to display the name.
- Returns:
- the localized script name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayScript
public static String getDisplayScript(String localeID,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's script localized for display in the provided locale.
- Parameters:
localeID
- the id of the locale whose script will be displayed.displayLocale
- the locale in which to display the name.
- Returns:
- the localized script name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayCountry
public String getDisplayCountry()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's country localized for display in the default locale.
- Returns:
- the localized country name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayCountry
public String getDisplayCountry(ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's country localized for display in the provided locale.
- Parameters:
displayLocale
- the locale in which to display the name.
- Returns:
- the localized country name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayCountry
public static String getDisplayCountry(String localeID,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's country localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose country will be displayeddisplayLocaleID
- the id of the locale in which to display the name.
- Returns:
- the localized country name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayCountry
public static String getDisplayCountry(String localeID,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's country localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose country will be displayed.displayLocale
- the locale in which to display the name.
- Returns:
- the localized country name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayVariant
public String getDisplayVariant()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's variant localized for display in the default locale.
- Returns:
- the localized variant name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayVariant
public String getDisplayVariant(ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale's variant localized for display in the provided locale.
- Parameters:
displayLocale
- the locale in which to display the name.
- Returns:
- the localized variant name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayVariant
public static String getDisplayVariant(String localeID,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's variant localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose variant will be displayeddisplayLocaleID
- the id of the locale in which to display the name.
- Returns:
- the localized variant name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayVariant
public static String getDisplayVariant(String localeID,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a locale's variant localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose variant will be displayed.displayLocale
- the locale in which to display the name.
- Returns:
- the localized variant name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeyword
public static String getDisplayKeyword(String keyword)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword localized for display in the default locale.
- Parameters:
keyword
- the keyword to be displayed.
- Returns:
- the localized keyword name.
- See Also:
getKeywords()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeyword
public static String getDisplayKeyword(String keyword,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword localized for display in the specified locale.
- Parameters:
keyword
- the keyword to be displayed.displayLocaleID
- the id of the locale in which to display the keyword.
- Returns:
- the localized keyword name.
- See Also:
getKeywords()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeyword
public static String getDisplayKeyword(String keyword,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword localized for display in the specified locale.
- Parameters:
keyword
- the keyword to be displayed.displayLocale
- the locale in which to display the keyword.
- Returns:
- the localized keyword name.
- See Also:
getKeywords()
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeywordValue
public String getDisplayKeywordValue(String keyword)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword value localized for display in the default locale.
- Parameters:
keyword
- the keyword whose value is to be displayed.
- Returns:
- the localized value name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeywordValue
public String getDisplayKeywordValue(String keyword,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword value localized for display in the specified locale.
- Parameters:
keyword
- the keyword whose value is to be displayed.displayLocale
- the locale in which to display the value.
- Returns:
- the localized value name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeywordValue
public static String getDisplayKeywordValue(String localeID,
String keyword,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword value localized for display in the specified locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose keyword value is to be displayed.keyword
- the keyword whose value is to be displayed.displayLocaleID
- the id of the locale in which to display the value.
- Returns:
- the localized value name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayKeywordValue
public static String getDisplayKeywordValue(String localeID,
String keyword,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns a keyword value localized for display in the specified locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the id of the locale whose keyword value is to be displayed.keyword
- the keyword whose value is to be displayed.displayLocale
- the id of the locale in which to display the value.
- Returns:
- the localized value name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayName
public String getDisplayName()
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale name localized for display in the default locale.
- Returns:
- the localized locale name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayName
public String getDisplayName(ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns this locale name localized for display in the provided locale.
- Parameters:
displayLocale
- the locale in which to display the locale name.
- Returns:
- the localized locale name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayName
public static String getDisplayName(String localeID,
String displayLocaleID)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the locale ID localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the locale whose name is to be displayed.displayLocaleID
- the id of the locale in which to display the locale name.
- Returns:
- the localized locale name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
getDisplayName
public static String getDisplayName(String localeID,
ULocale displayLocale)
- Deprecated. This is a draft API and might change in a future release of ICU.
- Returns the locale ID localized for display in the provided locale.
This is a cover for the ICU4C API.
- Parameters:
localeID
- the locale whose name is to be displayed.displayLocale
- the locale in which to display the locale name.
- Returns:
- the localized locale name.
- Status:
- Draft ICU 3.0.
- Status:
- Deprecated in This is a draft API and might change in a future release of ICU..
Copyright (c) 2004 IBM Corporation and others.