sap-commerce-cloudbackoffice

How to get localized name of an attribute of an item type in Hybris?


I need localized name of the field of a new itemtype I created, can someone please point out if there are any existing service/utility available for achieving the same.

Thanks in advance.


Solution

  • You can use below util class:

    de.hybris.platform.util.localization.Localization.getLocalizedString("type.MyItemType.myProperty.name");
    

    Above function using jalo session locale. If you want to get for any translation, you need to create your own function. You can check above function implementation and create your own function.