Package de.aikiit.fotorenamer.util
Class LocalizationHelper
java.lang.Object
de.aikiit.fotorenamer.util.LocalizationHelper
Helper to deal with localizations and ease the usage of
resource bundles within fotorenamer.
- Version:
- 23.08.11
- Author:
- hirsch
-
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 String
removeCrLf
(String input) Helper method to prevent CRLF injection in logs.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. fotorenamer.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. fotorenamer.foo.parameteredtitle.parameters
- Object array with all parameters.- Returns:
- Returns the value from the bundle with the given parameters applied.
- See Also:
-
removeCrLf
Helper method to prevent CRLF injection in logs.- Parameters:
input
- any input- Returns:
- input without CRLF.
-