Package org.craftercms.commons.i10n
Class I10nUtils
- java.lang.Object
-
- org.craftercms.commons.i10n.I10nUtils
-
public class I10nUtils extends Object
Utility class for localization stuff.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ERROR_MESSAGE_BUNDLE_NAME
static String
DEFAULT_LOGGING_MESSAGE_BUNDLE_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getLocalizedMessage(String bundleName, String key, Object... args)
Returns a formatted, localized message according to the specified resource bundle and key.static String
getLocalizedMessage(ResourceBundle bundle, String key, Object... args)
Returns a formatted, localized message according to the specified resource bundle and key.
-
-
-
Field Detail
-
DEFAULT_ERROR_MESSAGE_BUNDLE_NAME
public static final String DEFAULT_ERROR_MESSAGE_BUNDLE_NAME
- See Also:
- Constant Field Values
-
DEFAULT_LOGGING_MESSAGE_BUNDLE_NAME
public static final String DEFAULT_LOGGING_MESSAGE_BUNDLE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocalizedMessage
public static String getLocalizedMessage(String bundleName, String key, Object... args)
Returns a formatted, localized message according to the specified resource bundle and key.- Parameters:
bundleName
- the name of the resource bundle where the message format should bekey
- the key of the message formatargs
- the args of the message format- Returns:
- the formatted, localized message
-
getLocalizedMessage
public static String getLocalizedMessage(ResourceBundle bundle, String key, Object... args)
Returns a formatted, localized message according to the specified resource bundle and key.- Parameters:
bundle
- the resource bundle where the message format should bekey
- the key of the message formatargs
- the args of the message format- Returns:
- the formatted, localized message
-
-