Class LocalizationHelper

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

public final class LocalizationHelper extends Object
Helper to deal with localizations and ease the usage of resource bundles within fotorenamer.
Version:
23.08.11
Author:
hirsch
  • 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. fotorenamer.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. fotorenamer.foo.parameteredtitle.
      parameters - Object array with all parameters.
      Returns:
      Returns the value from the bundle with the given parameters applied.
      See Also:
    • removeCrLf

      public static String removeCrLf(String input)
      Helper method to prevent CRLF injection in logs.
      Parameters:
      input - any input
      Returns:
      input without CRLF.