| java.lang.Object jimm.util.I18N
I18N | public class I18N (Code) | | 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").
author: Jim Menard, jimm@io.com |
Method Summary | |
public static String | get(String key) Returns the string corresponding to the specified string. | public static String | get(String prefix, String key) Returns the string corresponding to the specified string in the bundle
file corresponding to the name prefix. | protected static ResourceBundle | getBundle(String prefix) | public static String | getNullIfMissing(String key) Returns the string corresponding to the specified string. | public static String | getNullIfMissing(String prefix, String key) Returns the string corresponding to the specified string in the bundle
file corresponding to the name prefix. | public static void | setLanguage(Locale l) Given a locale, start using the code short phrases for that lanuage.
Normally, you won't have to call this method. |
MENU_FILE_PREFIX | final public static String MENU_FILE_PREFIX(Code) | | |
PAPER_FILE_PREFIX | final public static String PAPER_FILE_PREFIX(Code) | | |
RESOURCE_FILE_PREFIX | final public static String RESOURCE_FILE_PREFIX(Code) | | |
get | public static String get(String key)(Code) | | Returns the string corresponding to the specified string. Returns
key if key is either null or the
empty string. Reports an error if key does not exist.
Parameters: key - the lookup key the string corresponding to the specified lookup keyor null if there isn't one; if key is theempty string, return it |
get | public static String get(String prefix, String key)(Code) | | Returns the string corresponding to the specified string in the bundle
file corresponding to the name prefix. Returns key
if key is either null or the empty string.
Reports an error if key does not exist.
Parameters: prefix - the bundle file name prefix Parameters: key - the lookup key the string corresponding to the specified lookup keyor null if there isn't one; if key is theempty string, return it |
getNullIfMissing | public static String getNullIfMissing(String key)(Code) | | Returns the string corresponding to the specified string. Returns
key if key is either null or the
empty string. Reports null if key does not exist.
Parameters: key - the lookup key the string corresponding to the specified lookup keyor null if there isn't one; if key is theempty string, return it |
getNullIfMissing | public static String getNullIfMissing(String prefix, String key)(Code) | | Returns the string corresponding to the specified string in the bundle
file corresponding to the name prefix. Returns key
if key is either null or the empty string.
Reports null if key does not exist.
Parameters: prefix - the bundle file name prefix Parameters: key - the lookup key the string corresponding to the specified lookup keyor null if there isn't one; if key is theempty string, return it |
setLanguage | public static void setLanguage(Locale l)(Code) | | Given a locale, start using the code short phrases for that lanuage.
Normally, you won't have to call this method. It gets called at startup
and sets the locale to the default one.
Parameters: l - the new locale |
|
|