Class Localization
- java.lang.Object
-
- de.hybris.platform.util.localization.Localization
-
public class Localization extends java.lang.ObjectHelper class for localization handling.
-
-
Constructor Summary
Constructors Constructor Description Localization()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<Language,java.lang.String>getLocalizedMap(java.lang.String key)Returns a map which can be used as a parameter for setAllNames() of any localized item.static java.lang.StringgetLocalizedString(java.lang.String key)Return the localization of an given key and the current session language.static java.lang.StringgetLocalizedString(java.lang.String key, java.lang.Object[] arguments)Return the localization of an given key and the current session language.
-
-
-
Method Detail
-
getLocalizedString
public static java.lang.String getLocalizedString(java.lang.String key, java.lang.Object[] arguments)Return the localization of an given key and the current session language. The localized string will be processed byMessageFormatusing givenarguments.- Parameters:
key- the keyarguments- list of values for the text arguments (see MessageFormat.format(String, Object[]))- Returns:
- the localized string
-
getLocalizedString
public static java.lang.String getLocalizedString(java.lang.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 java.util.Map<Language,java.lang.String> getLocalizedMap(java.lang.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
-
-