Class LocalizationHelper

java.lang.Object
de.aikiit.spamprotector.util.LocalizationHelper

public final class LocalizationHelper extends Object
Helper to deal with localizations and ease the usage of resource bundles within spamschutz.
  • 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

      public static Locale getLocale()
      Returns:
      the currently set Locale of this application. Fallback is Locale.GERMANY.
    • getLanguage

      public static String getLanguage()
      Returns:
      the currently set language
    • getBundleString

      public static String getBundleString(String key)
      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

      public static String getParameterizedBundleString(String key, Object... parameters)
      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.title
      parameters - Object array with all parameters.
      Returns:
      Returns the value from the bundle with the given parameters applied.
      See Also: