Package org.onehippo.repository.l10n
Interface ResourceBundle
public interface ResourceBundle
A
ResourceBundle
is a set of Strings identified by keys
A ResourceBundle
is associated with a Locale
making the Strings specific for that Locale
.
ResourceBundle
s can be obtained by name from the LocalizationService
.
ResourceBundle
s are ordered in a fallback hierarchy. If a String is not defined
in the current bundle the call is forwarded to the parent bundle.
See LocalizationService
for an exact description.-
Method Summary
Modifier and TypeMethodDescriptionTheLocale
of thisResourceBundle
.getName()
The name of thisResourceBundle
.Gets theLocale
-specific translation identified by a givenkey
.default String
Gets theLocale
-specific translation identified by a givenkey
.default String
Gets theLocale
-specific translation identified by a givenkey
.default ResourceBundle
-
Method Details
-
getLocale
Locale getLocale()TheLocale
of thisResourceBundle
. -
getName
String getName()The name of thisResourceBundle
. -
getString
Gets theLocale
-specific translation identified by a givenkey
. If a String is not defined in this bundle the call is forwarded to the parent bundle.- Parameters:
key
- akey
identifying a String- Returns:
- the String identified by a
key
-
getString
Gets theLocale
-specific translation identified by a givenkey
. If a String is not defined in this bundle the call is forwarded to the parent bundle. Variables in the Strings can be replaced by supplying parameters. The default definition of a variable is${variableName}
. If the label has only one variable usegetString(String, String, String)
.- Parameters:
key
- akey
identifying a Stringparameters
- a map of names and values to replace variables- Returns:
- the String identified by a
key
with replaced variables
-
getString
Gets theLocale
-specific translation identified by a givenkey
. If a String is not defined in this bundle the call is forwarded to the parent bundle. One variable in the String can be replaced by the parameterName and parameterValue. The default definition of a variable is${variableName}
. Convenience method for Strings with only one variable. If there are multiple variables usegetString(String, Map)
.- Parameters:
key
- akey
identifying a StringparameterName
- the name of the variable as defined in the StringparameterValue
- the replacement value for the variable- Returns:
- the String identified by a
key
with replaced variables
-
toJavaResourceBundle
-