|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.i18n.I18NEncodingUtil
ariba.util.i18n.I18NUtil
public class I18NUtil
Class I18NUtil provides I18N related constants and utility functions
Field Summary | |
---|---|
static java.util.Locale |
Arabic
|
static java.lang.String |
EncodingKorean
We use GB2312 encoding for the korean HTML client. |
static java.lang.String |
EncodingShiftJIS
We use the non-standard Shift_JIS encoding for the japanese HTML client. |
static java.lang.String |
EncodingUTF8
We use the standard UTF8 encoding for XML files as well as doing CGI posts to our own server. |
static java.util.Locale |
Hebrew
Languages that are not defined in java.util.Locale |
static java.lang.String |
Left
|
static java.lang.String |
LeftToRight
HTML direction parameter value |
static java.lang.String |
Right
|
static java.lang.String |
RightToLeft
|
Fields inherited from class ariba.util.i18n.I18NEncodingUtil |
---|
EncodingASCII, EncodingBig5, EncodingCp1250, EncodingCp1251, EncodingCp1252, EncodingCp1253, EncodingCp1254, EncodingEUC_JP, EncodingEUC_KR, EncodingGB2312, EncodingISO2022CN, EncodingISO2022JP, EncodingISO2022KR, EncodingISO8859_1, EncodingISO8859_2, EncodingISO8859_8, EncodingKSC5601, EncodingMS932, EncodingShift_JIS, EncodingUTF_8 |
Constructor Summary | |
---|---|
I18NUtil()
Class constructor. |
Method Summary | |
---|---|
static boolean |
enableTooltips(boolean isBrowserNetscape,
java.lang.String encodingString,
java.util.Locale locale)
Returns boolean on whether to enable Tooltips |
static java.util.Locale |
getLocale(java.lang.String language,
java.lang.String country)
Create a Locale object from given language, country, variant |
static java.util.Locale |
getLocale(java.lang.String language,
java.lang.String country,
java.lang.String localeVariant)
Create a Locale object from given language, country, variant |
static java.util.Locale |
getLocaleFromString(java.lang.String locale)
Create a Locale object for the locale specified by a String. |
static java.util.Locale |
getParent(java.util.Locale locale)
Returns the parent Locale of locale . |
static boolean |
isBidirectional(java.util.Locale locale)
Returns true if locale is Hebrew/Arabic |
static boolean |
isCJK(java.util.Locale locale)
Returns true if locale is Chinese/Japanese/Korean |
static boolean |
isLatin1(java.util.Locale locale)
Returns true if locale is Latin-1: English, Danish, Dutch, French, German, Finnish, Icelandic, Irish, Italian, Spanish, Norwegian, Brazilian, Portuguese. |
static java.lang.String |
javaEncodingToIANACharset(java.lang.String encoding)
call this to get the correct CHARSET string to embed in MIME, HTML, or XML. |
static java.lang.String |
languageDirection(java.util.Locale locale)
Returns value for HTML direction attribute according to the locale |
static java.lang.String |
languageLeft(java.util.Locale locale)
Returns value for HTML direction attribute according to the locale |
static java.lang.String |
languageRight(java.util.Locale locale)
Returns value for HTML direction attribute according to the locale |
static java.lang.String |
mimeEncoding(java.lang.String charset)
Returns either B or Q mime encoding for the given charset B encoding is BASE64. |
static int |
stringLengthBytes(java.lang.String string,
java.lang.String encoding)
Deprecated. see LocaleSupport.widthInBytes(String, Locale) |
static int |
stringWidthWhenPrinted(java.lang.String string,
java.lang.String encoding)
Deprecated. see LocaleSupport.widthInBytes(String, Locale) |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Locale Hebrew
public static final java.util.Locale Arabic
public static final java.lang.String LeftToRight
public static final java.lang.String RightToLeft
public static final java.lang.String Right
public static final java.lang.String Left
public static final java.lang.String EncodingUTF8
public static final java.lang.String EncodingShiftJIS
public static final java.lang.String EncodingKorean
Constructor Detail |
---|
public I18NUtil()
Method Detail |
---|
public static boolean isLatin1(java.util.Locale locale)
locale
- the locale to decide on
public static boolean isCJK(java.util.Locale locale)
locale
- the locale to decide on
public static boolean isBidirectional(java.util.Locale locale)
locale
- the locale to get the encoding string of
public static java.lang.String languageDirection(java.util.Locale locale)
locale
- the locale to get the encoding string of
public static java.lang.String languageLeft(java.util.Locale locale)
locale
- the locale to get the encoding string of
public static java.lang.String languageRight(java.util.Locale locale)
locale
- the locale to get the encoding string of
public static java.lang.String javaEncodingToIANACharset(java.lang.String encoding)
encoding
- the encoding string in java form
public static java.lang.String mimeEncoding(java.lang.String charset)
charset
- the charset string
public static java.util.Locale getLocale(java.lang.String language, java.lang.String country)
language
- locale languagecountry
- locale country
public static java.util.Locale getLocale(java.lang.String language, java.lang.String country, java.lang.String localeVariant)
language
- locale languagecountry
- locale countrylocaleVariant
- locale variant
public static java.util.Locale getLocaleFromString(java.lang.String locale)
locale
- Locale description string in the form of
Locale.toString() (e.g. "en_US").
public static java.util.Locale getParent(java.util.Locale locale)
Locale
of locale
.
By parent we mean the Locale
that logically contains
the passed-in Locale
(where language
is
deemed to contain country
which is deemed to contain
variant
.
Thus 'en' is the parent of 'en_US' and 'fr_FR' is the parent of 'fr_FR_var'.
Top-level Locales (those that specify languages only) do not
have a parent and null
is returned.
locale
- the Locale
, whose parent we wish to find; may not
be null
Locale
or null
if there is no
parentpublic static boolean enableTooltips(boolean isBrowserNetscape, java.lang.String encodingString, java.util.Locale locale)
isBrowserNetscape
- someone's still using Netscape?encodingString
- the HTML encodinglocale
- the user's Locale
public static int stringWidthWhenPrinted(java.lang.String string, java.lang.String encoding)
string
- printed stringencoding
- string encoding
public static int stringLengthBytes(java.lang.String string, java.lang.String encoding)
string
- stringencoding
- encoding
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |