|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mailster.gui.Messages
public class Messages
---
Mailster (C) 2007-2009 De Oliveira Edouard
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See Mailster
Web Site
---
Messages.java - Handles localisation of UI.
| Field Summary | |
|---|---|
private static java.util.ResourceBundle |
bundle
The resource bundle. |
private static java.lang.String |
DEFAULT_RESOURCE_BASE
The default base name of the language resources, a fully qualified class name. |
private static java.util.ResourceBundle |
defaultBundle
The default resource bundle is the one corresponding to local Locale. |
private static java.util.TreeMap<java.lang.String,LanguageResource> |
LANGUAGE_RESOURCES
Stores the single LanguageResource objects in a sorted
TreeMap data structure |
private static java.util.Locale |
locale
The current locale. |
private static org.slf4j.Logger |
log
|
| Constructor Summary | |
|---|---|
private |
Messages()
|
| Method Summary | |
|---|---|
static LanguageResource[] |
getAvailableLanguageResources()
Gets all available LanguageResources |
static LanguageResource |
getLanguageResource(java.lang.String language)
Gets the LanguageResource mapped to the specified ISO 639
two letter language code (e.g. |
static java.util.Locale |
getLocale()
|
static java.lang.String |
getString(java.lang.String key)
Loads a string from the resource bundle file. |
static java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Loads a string from the resource bundle file. |
static void |
setLocale(java.util.Locale l)
NOTE : Will not reload the already loaded strings. |
private static void |
setupResourceBundle()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.slf4j.Logger log
private static final java.lang.String DEFAULT_RESOURCE_BASE
private static final java.util.TreeMap<java.lang.String,LanguageResource> LANGUAGE_RESOURCES
LanguageResource objects in a sorted
TreeMap data structure
private static java.util.Locale locale
private static java.util.ResourceBundle defaultBundle
Locale.
private static java.util.ResourceBundle bundle
| Constructor Detail |
|---|
private Messages()
| Method Detail |
|---|
private static void setupResourceBundle()
public static LanguageResource[] getAvailableLanguageResources()
LanguageResources
LanguageResource objects holding
all available resourcespublic static LanguageResource getLanguageResource(java.lang.String language)
LanguageResource mapped to the specified ISO 639
two letter language code (e.g. "de" for german, "en" for english)
language - the ISO 639 twoe letter language code for which
to get the mapped LanguageResource
LanguageResource mapped to the specified ISO 639
two letter language code (e.g. "de" for german, "en" for english);
null if no such LanguageResource is available
for the specified languagepublic static java.lang.String getString(java.lang.String key)
key - the key to load the message string
public static java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
defaultValue.
key - the key to load the message stringdefaultValue - the value to return if not found or empty
public static java.util.Locale getLocale()
public static void setLocale(java.util.Locale l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||