com.ecyrd.jspwiki.i18n
Class InternationalizationManager

java.lang.Object
  extended by com.ecyrd.jspwiki.i18n.InternationalizationManager

public class InternationalizationManager
extends Object

Manages all internationalization in JSPWiki.

Since:
2.6

Field Summary
static String CORE_BUNDLE
          The name of the ResourceBundle which contains any and all JSPWiki core resource strings.
 
Constructor Summary
InternationalizationManager(WikiEngine engine)
          Constructs a new InternationalizationManager.
 
Method Summary
 String get(String key)
          Returns a String from the CORE_BUNDLE using English as the default locale.
 String get(String bundle, Locale locale, String key)
          If you are too lazy to open your own bundle, use this method to get a string simply from a bundle.
 ResourceBundle getBundle(String bundle, Locale locale)
          Finds a resource bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_BUNDLE

public static final String CORE_BUNDLE
The name of the ResourceBundle which contains any and all JSPWiki core resource strings. It's value is "CoreResources".

See Also:
Constant Field Values
Constructor Detail

InternationalizationManager

public InternationalizationManager(WikiEngine engine)
Constructs a new InternationalizationManager.

Parameters:
engine - To which engine this belongs to
Method Detail

get

public String get(String key)
           throws MissingResourceException
Returns a String from the CORE_BUNDLE using English as the default locale.

Parameters:
key - Key to find
Returns:
The English string
Throws:
MissingResourceException - If there is no such key

getBundle

public ResourceBundle getBundle(String bundle,
                                Locale locale)
                         throws MissingResourceException
Finds a resource bundle.

Parameters:
bundle - The ResourceBundle to find. Must exist.
locale - The Locale to use. Set to null to get the default locale.
Returns:
A localized string
Throws:
MissingResourceException - If the key cannot be located at all, even from the default locale.

get

public String get(String bundle,
                  Locale locale,
                  String key)
           throws MissingResourceException
If you are too lazy to open your own bundle, use this method to get a string simply from a bundle.

Parameters:
bundle - Which bundle the string is in
locale - Locale to use - null for default
key - Which key to use.
Returns:
A localized string (or from the default language, if not found)
Throws:
MissingResourceException - If the key cannot be located at all, even from the default locale.