Package de.aikiit.spamprotector.util
Class LocalizationHelper
java.lang.Object
de.aikiit.spamprotector.util.LocalizationHelper
Helper to deal with localizations and ease the usage of
resource bundles within spamschutz.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBundleString
(String key) Helper function to retrieve a given key from the underlying resource bundle.static String
static Locale
static String
getParameterizedBundleString
(String key, Object... parameters) Helper function to retrieve a given key from the underlying resource bundle while applying localization parameters.static void
Set locale depending on system properties, in case of errors fallback is Locale.GERMANY.
-
Constructor Details
-
LocalizationHelper
public LocalizationHelper()
-
-
Method Details
-
setLocale
public static void setLocale()Set locale depending on system properties, in case of errors fallback is Locale.GERMANY. -
getLocale
- Returns:
- the currently set Locale of this application. Fallback is Locale.GERMANY.
-
getLanguage
- Returns:
- the currently set language
-
getBundleString
Helper function to retrieve a given key from the underlying resource bundle.- Parameters:
key
- Key to retrieve from the bundle, e.g. spamprotector.foo.title- Returns:
- Returns the value from the bundle.
-
getParameterizedBundleString
Helper function to retrieve a given key from the underlying resource bundle while applying localization parameters.- Parameters:
key
- Key to retrieve from the bundle, e.g. spamprotector.foo.titleparameters
- Object array with all parameters.- Returns:
- Returns the value from the bundle with the given parameters applied.
- See Also:
-