public interface NLS
Each instance of a NLS manages a set of messages, and each message is defined by a unique ID (int value).
Each language is defined by a locale string. By convention, a locale represents a specific geographical, political, or cultural region. It is often represented using the concatenation of a language code and a country code:
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getAvailableLocales()
Gets the list of available locales.
|
java.lang.String |
getCurrentLocale()
Gets the current locale.
|
java.lang.String |
getDisplayName(java.lang.String locale)
Gets the human-readable name of the given locale.
|
java.lang.String |
getMessage(int messageID)
Gets the message matching an ID in the current language.
|
java.lang.String |
getMessage(int messageID,
java.lang.String locale)
Gets the message matching an ID in a specific language.
|
void |
setCurrentLocale(java.lang.String locale)
Changes the current locale.
|
java.lang.String[] getAvailableLocales()
java.lang.String getDisplayName(java.lang.String locale)
locale
- the locale.java.lang.String getMessage(int messageID)
messageID
- the ID of the message to retrieve.java.lang.ArrayIndexOutOfBoundsException
- if the given messageID does not match a valid message.java.lang.String getMessage(int messageID, java.lang.String locale)
messageID
- the ID of the message to retrieve.locale
- the locale to use.java.lang.ArrayIndexOutOfBoundsException
- if the given messageID does not match a valid message.void setCurrentLocale(java.lang.String locale)
locale
- the locale to set.java.lang.String getCurrentLocale()