public class InternationalizationManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CORE_BUNDLE
The name of the ResourceBundle which contains any and all JSPWiki core
resource strings.
|
static String |
DEF_TEMPLATE
The name of the ResourceBundle which contains any and all JSPWiki default templates
resource strings.
|
Constructor and Description |
---|
InternationalizationManager(WikiEngine engine)
Constructs a new InternationalizationManager.
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
get(String bundle,
Locale locale,
String key,
Object... args)
Obtain a parameterized String from the bundle.
|
ResourceBundle |
getBundle(String bundle,
Locale locale)
Finds a resource bundle.
|
public static final String CORE_BUNDLE
public static final String DEF_TEMPLATE
public InternationalizationManager(WikiEngine engine)
engine
- To which engine this belongs topublic String get(String key) throws MissingResourceException
key
- Key to findMissingResourceException
- If there is no such keypublic ResourceBundle getBundle(String bundle, Locale locale) throws MissingResourceException
bundle
- The ResourceBundle to find. Must exist.locale
- The Locale to use. Set to null to get the default locale.MissingResourceException
- If the key cannot be located at all, even from the default locale.public String get(String bundle, Locale locale, String key) throws MissingResourceException
bundle
- Which bundle the string is inlocale
- Locale to use - null for defaultkey
- Which key to use.MissingResourceException
- If the key cannot be located at all, even from the default locale.public String get(String bundle, Locale locale, String key, Object... args) throws MissingResourceException
bundle
- Which bundle the string is inlocale
- Locale to use - null for defaultkey
- Which key to use.args
- parameters to insert in the String.MissingResourceException
- If the key cannot be located at all, even from the default locale.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.