Method Summary |
|
public static String | format(String bundleName, Locale locale, String key, Object arg1) |
public static String | format(String bundleName, Locale locale, String key, Object arg1, Object arg2) |
public static String | format(String bundleName, Locale locale, String key, Object[] args) |
public static ResourceBundle | getBundle(String bundleName) Convenience method to get a ResourceBundle based on name.
Parameters: bundleName - Name of bundle. |
public static ResourceBundle | getBundle(String bundleName, String languageHeader) Convenience method to get a ResourceBundle based on name and
HTTP Accept-Language header.
Parameters: bundleName - Name of bundle. Parameters: languageHeader - A String with the language header. |
public static ResourceBundle | getBundle(HttpServletRequest req) Convenience method to get a ResourceBundle based on name and
HTTP Accept-Language header in HttpServletRequest.
Parameters: req - HttpServletRequest. |
public static ResourceBundle | getBundle(String bundleName, HttpServletRequest req) Convenience method to get a ResourceBundle based on name and
HTTP Accept-Language header in HttpServletRequest.
Parameters: bundleName - Name of bundle. Parameters: req - HttpServletRequest. |
public static ResourceBundle | getBundle(String bundleName, Locale locale) Convenience method to get a ResourceBundle based on name and
Locale.
Parameters: bundleName - Name of bundle. Parameters: locale - A Locale. |
public static String | getDefaultBundleName() |
public static String | getDefaultCountry() |
public static String | getDefaultLanguage() |
public static Locale | getLocale(HttpServletRequest req) |
public static Locale | getLocale(String languageHeader) This method parses the Accept-Language header and
attempts to create a Locale out of it.
Parameters: languageHeader - A String with the language header. |
final protected static LocalizationService | getService() Gets the LocalizationService implementation. |
public static String | getString(String key) Pulls a string out of the LocalizationService with the default
locale values of what is defined in the
TurbineResources.properties file for the
locale.default.language and locale.default.country property
values. |
public static String | getString(Locale locale, String key) |
public static String | getString(String bundleName, Locale locale, String key) Fetches the localized text from the specified bundle, ignoring
any default bundles. |
public static String | getString(HttpServletRequest req, String key) Convenience method that pulls a localized string off the
LocalizationService using the ResourceBundle based on HTTP
Accept-Language header in HttpServletRequest.
Parameters: req - The HTTP request to parse the Accept-Language of. Parameters: key - Name of string. |
public static String | getString(String key, String lang) Convenience method that pulls a localized string off the
LocalizationService using the default ResourceBundle name
defined in the TurbineResources.properties file and the
specified language name in ISO format.
Parameters: key - Name of string. Parameters: lang - Desired language for the localized string. |
public static String | getString(String key, Locale locale) |
public static String | getString(String key, HttpServletRequest req) |
public static void | setBundle(String defaultBundle) This method sets the name of the default bundle. |
public static void | setLocalizationService(LocalizationService service) |