|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjimm.util.I18N
public class I18N
This class finds the local version of any string. It also contains a method for changing the language.
Each language should have a file called datavision_XX_YY.properties, where XX is the language code (e.g., "en" for English, "fr" for French) and YY is the country code (e.g., "US", "FR").
| Field Summary | |
|---|---|
protected static java.util.HashMap |
bundles
|
protected static java.util.Locale |
locale
|
static java.lang.String |
MENU_FILE_PREFIX
|
static java.lang.String |
PAPER_FILE_PREFIX
|
static java.lang.String |
RESOURCE_FILE_PREFIX
|
| Constructor Summary | |
|---|---|
I18N()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
get(java.lang.String key)
Returns the string corresponding to the specified string. |
static java.lang.String |
get(java.lang.String prefix,
java.lang.String key)
Returns the string corresponding to the specified string in the bundle file corresponding to the name prefix. |
protected static java.util.ResourceBundle |
getBundle(java.lang.String prefix)
|
static java.lang.String |
getNullIfMissing(java.lang.String key)
Returns the string corresponding to the specified string. |
static java.lang.String |
getNullIfMissing(java.lang.String prefix,
java.lang.String key)
Returns the string corresponding to the specified string in the bundle file corresponding to the name prefix. |
static void |
setLanguage(java.util.Locale l)
Given a locale, start using the code short phrases for that lanuage. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RESOURCE_FILE_PREFIX
public static final java.lang.String MENU_FILE_PREFIX
public static final java.lang.String PAPER_FILE_PREFIX
protected static java.util.Locale locale
protected static java.util.HashMap bundles
| Constructor Detail |
|---|
public I18N()
| Method Detail |
|---|
public static void setLanguage(java.util.Locale l)
l - the new localepublic static java.lang.String get(java.lang.String key)
null or the
empty string. Reports an error if key does not exist.
key - the lookup key
null if there isn't one; if key is the
empty string, return it
public static java.lang.String get(java.lang.String prefix,
java.lang.String key)
null or the empty string.
Reports an error if key does not exist.
prefix - the bundle file name prefixkey - the lookup key
null if there isn't one; if key is the
empty string, return itpublic static java.lang.String getNullIfMissing(java.lang.String key)
null or the
empty string. Reports null if key does not exist.
key - the lookup key
null if there isn't one; if key is the
empty string, return it
public static java.lang.String getNullIfMissing(java.lang.String prefix,
java.lang.String key)
null or the empty string.
Reports null if key does not exist.
prefix - the bundle file name prefixkey - the lookup key
null if there isn't one; if key is the
empty string, return itprotected static java.util.ResourceBundle getBundle(java.lang.String prefix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||