|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.workingfrog.i18n.util.Localizer
This class manages the resource bundle files needed to localize the application. All registered resource files are searched in order to find the localization of a given string.
Constructor Summary | |
Localizer()
|
Method Summary | |
static void |
addResource(java.lang.String binding,
java.lang.String resourceName)
The method adds a new resource under the given name. |
static boolean |
containsKey(java.lang.String binding,
java.lang.String key)
|
static java.util.Locale |
getCurrentLocale()
The method returns the current locale. |
static java.util.Locale[] |
getLocales(java.lang.Object object)
|
static java.util.Map |
getResourcesFor(java.util.Locale locale)
The method returns all resources for the given locale. |
static javax.swing.KeyStroke |
getShortcut(java.lang.String binding,
java.lang.String key)
This function returns a localized menu shortcut key to the specified key. |
static java.lang.String |
localize(java.lang.String binding,
java.lang.String key)
This function returns a localized string corresponding to the specified key. |
static void |
switchCurrentLocale(java.util.Locale locale)
The method changes the current Locale to the given one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Localizer()
Method Detail |
public static void switchCurrentLocale(java.util.Locale locale)
Locale
public static java.util.Locale getCurrentLocale()
public static java.util.Map getResourcesFor(java.util.Locale locale)
locale
- Resources are searched for this locale.
public static void addResource(java.lang.String binding, java.lang.String resourceName) throws java.util.MissingResourceException
binding
- Name under which the resource should be registered.resourceName
- Name of the resource to be registered.
java.util.MissingResourceException
- when resourceName is invalidpublic static java.lang.String localize(java.lang.String binding, java.lang.String key)
binding
- bundle bindingkey
- String to be localized
public static boolean containsKey(java.lang.String binding, java.lang.String key)
public static javax.swing.KeyStroke getShortcut(java.lang.String binding, java.lang.String key)
binding
- Name of resource to be searched.key
- Shortcut string to be localized.
public static java.util.Locale[] getLocales(java.lang.Object object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |