Package sonia.scm.i18n
Class Bundle
java.lang.Object
sonia.scm.i18n.Bundle
This class is a wrapper for
ResourceBundle
, it applies some missing
format options missing in ResourceBundle
.- Since:
- 1.15
-
Method Summary
Modifier and TypeMethodDescriptionstatic Bundle
Creates a new bundle instancestatic Bundle
Creates a new bundle instancestatic Bundle
getBundle
(String path, Locale locale, ClassLoader classLoader) Creates a new bundle instanceThis method returns the same value asgetString(java.lang.String, java.lang.Object[])
with a line separator at the end.Returns the value of the key, formatted withMessageFormat
getStringIfPresent
(String key, Object... args) Returns the value of the key, formatted withMessageFormat
or null if the key is not present in the bundle.
-
Method Details
-
getBundle
Creates a new bundle instance- Parameters:
path
- path to the properties file- Returns:
- new bundle instance
-
getBundle
Creates a new bundle instance- Parameters:
path
- path to the properties filelocale
- locale for the properties file- Returns:
- new bundle instance
-
getBundle
Creates a new bundle instance- Parameters:
path
- path to the properties filelocale
- locale for the properties fileclassLoader
- classLoader to load- Returns:
- new bundle instance
- Since:
- 1.37
-
getLine
This method returns the same value asgetString(java.lang.String, java.lang.Object[])
with a line separator at the end.- Parameters:
key
- key in the properties fileargs
- format arguments- Returns:
- formatted message
-
getString
Returns the value of the key, formatted withMessageFormat
- Parameters:
key
- key in the properties fileargs
- format arguments- Returns:
- formatted message
-
getStringIfPresent
Returns the value of the key, formatted withMessageFormat
or null if the key is not present in the bundle.- Parameters:
key
- key in the properties fileargs
- format arguments- Returns:
- formatted message or null
- Since:
- 1.37
-