|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.i18n.I18NUtil
public class I18NUtil
Class I18NUtil provides I18N related constants and utility functions
| Field Summary | |
|---|---|
static Locale |
Arabic
|
static String |
EncodingASCII
We use the standard ASCII encoding for table files because the FormattingSerializer code already converts from Unicode escapes. |
static String |
EncodingBig5
We use Big5 encoding for the traditional chinese HTML client. |
static String |
EncodingCp1251
Cp1251 encoding |
static String |
EncodingCp1252
Cp1252 encoding |
static String |
EncodingGB2312
We use GB2312 encoding for the simplified chinese HTML client. |
static String |
EncodingISO8859_1
We use the standard ISO 8859-1 encoding for the old HTML client while it still lives. |
static String |
EncodingKorean
We use GB2312 encoding for the korean HTML client. |
static String |
EncodingShiftJIS
We use the non-standard Shift_JIS encoding for the japanese HTML client. |
static String |
EncodingUTF_8
|
static String |
EncodingUTF8
We use the standard UTF8 encoding for XML files as well as doing CGI posts to our own server. |
static Locale |
Hebrew
Languages that are not defined in java.util.Locale |
static String |
Left
|
static String |
LeftToRight
HTML direction parameter value |
static String |
Right
|
static String |
RightToLeft
|
| Constructor Summary | |
|---|---|
I18NUtil()
Class constructor. |
|
| Method Summary | |
|---|---|
static boolean |
enableTooltips(boolean isBrowserNetscape,
String encodingString,
Locale locale)
Returns boolean on whether to enable Tooltips |
static Locale |
getLocale(String language,
String country)
Create a Locale object from given language, country, variant |
static Locale |
getLocale(String language,
String country,
String localeVariant)
Create a Locale object from given language, country, variant |
static Locale |
getLocaleFromString(String locale)
Create a Locale object for the locale specified by a String. |
static Locale |
getParent(Locale locale)
Returns the parent Locale of locale. |
static boolean |
isBidirectional(Locale locale)
Returns true if locale is Hebrew/Arabic |
static boolean |
isCJK(Locale locale)
Returns true if locale is Chinese/Japanese/Korean |
static boolean |
isLatin1(Locale locale)
Returns true if locale is Latin-1: English, Danish, Dutch, French, German, Finnish, Icelandic, Irish, Italian, Spanish, Norwegian, Brazilian, Portuguese. |
static String |
javaEncodingToIANACharset(String encoding)
call this to get the correct CHARSET string to embed in MIME, HTML, or XML. |
static String |
languageDirection(Locale locale)
Returns value for HTML direction attribute according to the locale |
static String |
languageLeft(Locale locale)
Returns value for HTML direction attribute according to the locale |
static String |
languageRight(Locale locale)
Returns value for HTML direction attribute according to the locale |
static String |
mimeEncoding(String charset)
Returns either B or Q mime encoding for the given charset B encoding is BASE64. |
static int |
stringLengthBytes(String string,
String encoding)
Deprecated. see LocaleSupport.widthInBytes(String, Locale) |
static int |
stringWidthWhenPrinted(String string,
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 Locale Hebrew
public static final Locale Arabic
public static final String LeftToRight
public static final String RightToLeft
public static final String Right
public static final String Left
public static final String EncodingUTF8
public static final String EncodingUTF_8
public static final String EncodingASCII
public static final String EncodingISO8859_1
public static final String EncodingShiftJIS
public static final String EncodingGB2312
public static final String EncodingBig5
public static final String EncodingKorean
public static final String EncodingCp1252
public static final String EncodingCp1251
| Constructor Detail |
|---|
public I18NUtil()
| Method Detail |
|---|
public static boolean isLatin1(Locale locale)
locale - the locale to decide on
public static boolean isCJK(Locale locale)
locale - the locale to decide on
public static boolean isBidirectional(Locale locale)
locale - the locale to get the encoding string of
public static String languageDirection(Locale locale)
locale - the locale to get the encoding string of
public static String languageLeft(Locale locale)
locale - the locale to get the encoding string of
public static String languageRight(Locale locale)
locale - the locale to get the encoding string of
public static String javaEncodingToIANACharset(String encoding)
encoding - the encoding string in java form
public static String mimeEncoding(String charset)
charset - the charset string
public static Locale getLocale(String language,
String country)
language - locale languagecountry - locale country
public static Locale getLocale(String language,
String country,
String localeVariant)
language - locale languagecountry - locale countrylocaleVariant - locale variant
public static Locale getLocaleFromString(String locale)
locale - Locale description string in the form of
Locale.toString() (e.g. "en_US").
public static Locale getParent(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
parent
public static boolean enableTooltips(boolean isBrowserNetscape,
String encodingString,
Locale locale)
isBrowserNetscape - someone's still using Netscape?encodingString - the HTML encodinglocale - the user's Locale
public static int stringWidthWhenPrinted(String string,
String encoding)
string - printed stringencoding - string encoding
public static int stringLengthBytes(String string,
String encoding)
string - stringencoding - encoding
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||