|
Oracle® Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.i18n.util.OraDisplayLocaleInfo
The OraDisplayLocaleInfo
class is a utility class that provides predefined translations for locale related attributes. These attributes can be items like the display name for locales, languages, character sets, timezones, etc.
To use the services of this class, first an OraDisplayLocaleInfo
object should be instantiated by calling the getInstance(java.util.Locale)
method. The getInstance()
method takes a Locale
parameter that controls the translation language of any locale display items that are retrieved via the API. The example below shows how to retrieve a German translation for the Java timezone identifier America/Los_Angeles:
...
OraDisplayLocaleInfo odli = OraDisplayLocaleInfo.getInstance(Locale.GERMANY);
TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
// tzName will contain the localized time zone string in German.
String tzName = odli.getDisplayTimeZone(tz);
Field Summary | |
static int |
DEFAULT Constant value to specify the DEFAULT formatting style. |
static int |
LONG Constant value to specify the LONG formatting style. |
static int |
SHORT Constant value to specify the SHORT formatting style. |
Method Summary | |
static String[][] |
getAvailableLanguages(Locale translocale) Returns the available language IDs along with their corresponding display names sorted in the translated display name order. |
static String[][] |
getAvailableTerritories(Locale translocale) Returns the available territory IDs along with their corresponding display names sorted in the display name order. |
static List |
getCommonLocales(Locale translocale) Returns a list of the common locales sorted by the translated names. |
String |
getDisplayCharacterSet(String charset) Returns a translated character set name. |
String |
getDisplayCountry(Locale locale) Returns a translated country or territory name. |
String |
getDisplayCountry(String country) Returns a translated country or territory name. |
String |
getDisplayCurrency(String currencySymbol) Returns a translated currency name. |
String |
getDisplayLanguage(Locale locale) Returns a translated language name. |
String |
getDisplayLanguage(String language) Returns a translated language name. |
String |
getDisplayLinguisticSort(String linguisticSort) Returns a translated linguistic sorting name. |
String |
getDisplayLocale(Locale locale) Returns a translated locale name for the passed in locale parameter. |
String |
getDisplayLocale(String oraLanguage, String oraTerritory) Returns a translated locale name for the passed in language/territory combination. |
String |
getDisplayTerritory(String territory) Returns a translated country or territory name. |
String |
getDisplayTimeZone(int style, String tzs) Returns a translated time zone name. |
String |
getDisplayTimeZone(int style, TimeZone tz) Returns a translated time zone name. |
String |
getDisplayTimeZone(String tzs) Returns a translated time zone name. |
String |
getDisplayTimeZone(TimeZone tz) Returns a translated time zone name. |
static oracle.i18n.util.OraDisplayLocaleInfo |
getInstance(Locale transLocale) Constructs or reuses an instance of the OraDisplayLocaleInfo class associated with the translation locale. |
static oracle.i18n.util.OraDisplayLocaleInfo |
getInstance(Locale transLocale, Locale defLocale) Constructs or reuses an instance of the OraDisplayLocaleInfo class associated with the translation locale. |
Locale |
getLocale() Returns the locale associated with this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SHORT
SHORT
formatting style.
public static final int LONG
LONG
formatting style.
public static final int DEFAULT
DEFAULT
formatting style.
Method Detail |
public Locale getLocale()
Locale
objectpublic static oracle.i18n.util.OraDisplayLocaleInfo getInstance(Locale transLocale)
OraDisplayLocaleInfo
class associated with the translation locale.transLocale
- a translation localeOraDisplayLocaleInfo
classpublic static oracle.i18n.util.OraDisplayLocaleInfo getInstance(Locale transLocale, Locale defLocale)
OraDisplayLocaleInfo
class associated with the translation locale. Uses the passed in default locale for fallback mechanism, if necessary.transLocale
- a translation localedefLocale
- the default localeOraDisplayLocaleInfo
classpublic String getDisplayLocale(Locale locale)
locale
- a locale to be translatedpublic String getDisplayLocale(String oraLanguage, String oraTerritory)
oraLanguage
- an Oracle language nameoraTerritory
- an Oracle territory namepublic String getDisplayLanguage(Locale locale)
locale
- a locale that includes the language to be translatedpublic String getDisplayLanguage(String language)
language
- an ISO based or Oracle language namepublic String getDisplayCountry(Locale locale)
locale
- a locale that includes the country to be translatedpublic String getDisplayCountry(String country)
country
- an ISO based or Oracle country name to be translatedpublic String getDisplayTerritory(String territory)
territory
- a country name to be translatedpublic String getDisplayTimeZone(TimeZone tz)
If the translation is not found, the return value is composed by using the return value of the getRawOffset
method in the form of (UTCSHH:MM)
where S
represents the sign of the value, HH
represents the hours of the offset, and MI
represents the minutes of the offset.
tz
- a time zone to be translatedpublic String getDisplayTimeZone(String tzs)
tzs
- a Java based time zone ID to be translated. If the time zone ID is invalid, UTC
is usedgetDisplayTimeZone(TimeZone)
public String getDisplayTimeZone(int style, TimeZone tz)
style
- the format style, for example, SHORT
, LONG
, or DEFAULT
tz
- a time zone to be translatedgetDisplayTimeZone(TimeZone)
public String getDisplayTimeZone(int style, String tzs)
style
- the format style, for example, SHORT
, LONG
, or DEFAULT
tzs
- a Java based time zone ID to be translated. If the time zone ID is invalid, UTC
is usedgetDisplayTimeZone(TimeZone)
public String getDisplayLinguisticSort(String linguisticSort)
linguisticSort
- an Oracle linguistic sorting name to be translatedpublic String getDisplayCharacterSet(String charset)
charset
- a character set name to be translated. The name can either be an IANA or Oracle based name.public String getDisplayCurrency(String currencySymbol)
currencySymbol
- a character set symbol ISO 4217public static List getCommonLocales(Locale translocale)
translocale
- the translation localeLocale
object listpublic static String[][] getAvailableLanguages(Locale translocale)
translocale
- the translation localepublic static String[][] getAvailableTerritories(Locale translocale)
translocale
- the translation locale
|
Oracle® Globalization Development Kit Java API Reference 10g Release 2 (10.2) Part No. B14224-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |