|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ca.commons.cbutil.CBIntText
This 'International Text' static class acts as a central source of all localised strings. If it cannot find a localised properties file, the default (english) file is used. If that file can not be found, the key used to look up the translation is returned unchanged - hence it is useful if the keys are meaningful in their own right (i.e. use 'File' rather than 'String 42' as a key).
Currently the class is static to provide easy access to i18n text by all classes and plugins, and because it is difficult to see how supporting multiple different-locale languages would be helpful (note that multiple languages can be supported simply by using unicode).
| Constructor Summary | |
CBIntText()
|
|
| Method Summary | |
static void |
addBundle(java.lang.String bundleLocation,
java.lang.ClassLoader customLoader)
Once init() has been called, this method can be used to add multiple resource bundles to the universal 'CBIntText' list of translations. |
static java.lang.String |
get(java.lang.String key)
This attempts to get the localised version of a string. |
static void |
init(java.lang.String bundleLocation,
java.lang.ClassLoader customLoader)
This initialises the international text class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CBIntText()
| Method Detail |
public static void init(java.lang.String bundleLocation,
java.lang.ClassLoader customLoader)
bundleLocation - the name of the i18n bundle (e.g. "language/JX_ja.properties").customLoader - a custom class loader (may be null). JX uses a custom loader
that auto-detects unicode and utf-8 files for ease of configuration by
non-expert users.
public static void addBundle(java.lang.String bundleLocation,
java.lang.ClassLoader customLoader)
public static java.lang.String get(java.lang.String key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||