|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.util.JAPMessages
public final class JAPMessages
Use this class to display GUI texts in the user's language. The texts Strings are loaded from properties files, so-called Resource Bundles. The default resource bundle is english and its name ends with '_en.properties'. Resource bundle files in other languages must have language specific endings as given by ISO 639. The default resource bundle must always be present and must contain all language strings. The other bundles may contain a subset of these strings.
http://www.w3.org/WAI/ER/IG/ert/iso639.htm
Field Summary | |
---|---|
private static java.util.Hashtable |
ms_cachedMessages
|
private static java.util.ResourceBundle |
ms_defaultResourceBundle
|
private static java.util.Locale |
ms_locale
|
private static java.util.ResourceBundle |
ms_resourceBundle
|
private static java.lang.Object |
SYNC
|
private static java.util.Locale |
SYSTEM_LOCALE
|
Constructor Summary | |
---|---|
private |
JAPMessages()
|
Method Summary | |
---|---|
private static java.lang.String |
getBundleLocalisedFilename(java.lang.String a_resourceBundleFilename,
java.util.Locale a_locale)
|
static java.util.Locale |
getLocale()
Returns the Locale that is used by this class to get the messages. |
static java.lang.String |
getString(java.lang.String a_key)
Gets the localised String for a given key. |
static java.lang.String |
getString(java.lang.String a_key,
java.lang.Object a_argument)
Gets the localised String for a given key. |
static java.lang.String |
getString(java.lang.String a_key,
java.lang.Object[] a_arguments)
Gets the localised String for a given key. |
static java.util.Locale |
getSystemLocale()
|
static boolean |
init(java.util.Locale locale,
java.lang.String a_resourceBundleFilename)
Initialises the resource bundle with the specified Locale. |
static boolean |
init(java.lang.String a_resourceBundleFilename)
Initialises the resource bundle with the System default Locale. |
static boolean |
isInitialised()
|
static void |
setLocale(java.util.Locale a_locale)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.ResourceBundle ms_resourceBundle
private static java.util.ResourceBundle ms_defaultResourceBundle
private static java.util.Locale ms_locale
private static final java.util.Locale SYSTEM_LOCALE
private static java.util.Hashtable ms_cachedMessages
private static final java.lang.Object SYNC
Constructor Detail |
---|
private JAPMessages()
Method Detail |
---|
public static java.util.Locale getSystemLocale()
public static boolean init(java.lang.String a_resourceBundleFilename)
a_resourceBundleFilename
- a file name for the resource bundle; the language code for the
locale will be added programmatically (e.g. _en, _de, ...).private static java.lang.String getBundleLocalisedFilename(java.lang.String a_resourceBundleFilename, java.util.Locale a_locale)
public static boolean init(java.util.Locale locale, java.lang.String a_resourceBundleFilename)
locale
- a Localea_resourceBundleFilename
- a file name for the resource bundle; the language code for the
locale will be added programmatically (e.g. _en, _de, ...).public static boolean isInitialised()
public static java.util.Locale getLocale()
public static void setLocale(java.util.Locale a_locale)
public static java.lang.String getString(java.lang.String a_key)
a_key
- a key for the localised String
public static java.lang.String getString(java.lang.String a_key, java.lang.Object[] a_arguments)
java.text.MessageFormat
.
a_key
- a key for the localised Stringa_arguments
- an object array that contains the objects that replace
MessageFormat
public static java.lang.String getString(java.lang.String a_key, java.lang.Object a_argument)
java.text.MessageFormat
.
a_key
- a key for the localised Stringa_argument
- a object that is inserted into the message String
MessageFormat
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |