Package org.apache.wiki.i18n
Interface InternationalizationManager
- All Known Implementing Classes:
DefaultInternationalizationManager
public interface InternationalizationManager
Manages all internationalization in JSPWiki.
- Since:
- 2.6
-
Field Summary
Fields Modifier and Type Field Description static StringCORE_BUNDLEThe name of the ResourceBundle which contains any and all JSPWiki core resource strings.static StringDEF_TEMPLATEThe name of the ResourceBundle which contains any and all JSPWiki default templates resource strings. -
Method Summary
Modifier and Type Method Description default Stringget(String key)Returns a String from the CORE_BUNDLE using English as the default locale.default Stringget(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.default Stringget(String bundle, Locale locale, String key, Object... args)Obtain a parameterized String from the bundle.default ResourceBundlegetBundle(String bundle, Locale locale)Finds a resource bundle.
-
Field Details
-
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
-
DEF_TEMPLATE
The name of the ResourceBundle which contains any and all JSPWiki default templates resource strings. It's value is "templates.default".- See Also:
- Constant Field Values
-
-
Method Details
-
get
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
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
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 inlocale- Locale to use - null for defaultkey- 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.
-
get
default String get(String bundle, Locale locale, String key, Object... args) throws MissingResourceExceptionObtain a parameterized String from the bundle.- Parameters:
bundle- Which bundle the string is inlocale- Locale to use - null for defaultkey- Which key to use.args- parameters to insert in the String.- 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.
-