Class Localization

java.lang.Object
de.hybris.platform.util.localization.Localization

public class Localization extends Object
Helper class for localization handling.
  • Constructor Details

    • Localization

      public Localization()
  • Method Details

    • getLocalizedString

      public static String getLocalizedString(String key, Object[] arguments)
      Return the localization of an given key and the current session language. The localized string will be processed by MessageFormat using given arguments.
      Parameters:
      key - the key
      arguments - list of values for the text arguments (see MessageFormat.format(String, Object[]))
      Returns:
      the localized string
    • getLocalizedString

      public static String getLocalizedString(String key)
      Return the localization of an given key and the current session language.
      Parameters:
      key - the key
      Returns:
      the localized string
    • getLocalizedMap

      public static Map<Language,String> getLocalizedMap(String key)
      Returns a map which can be used as a parameter for setAllNames() of any localized item.

      e.g. product.setAllNames( Localization.getLocalizedMap("myitemkey") );
      or locItem.setLocalizedProperty( sess_ctx_with_language_null, key, Localization.getLocalizedMap("myitemkey") );

      Parameters:
      key - the which can be found in the localization files
      Returns:
      the map