Class DefaultL10NService

java.lang.Object
de.hybris.platform.servicelayer.i18n.impl.DefaultL10NService
All Implemented Interfaces:
L10NService
Direct Known Subclasses:
DefaultL10NServiceTest.MockDefaultL10NService

public class DefaultL10NService extends Object implements L10NService
Default implementation of the l10n service interface.
  • Constructor Details

    • DefaultL10NService

      public DefaultL10NService()
  • Method Details

    • getResourceBundle

      public ResourceBundle getResourceBundle()
      Description copied from interface: L10NService
      Returns a ResourceBundle for all type localizations which supports hybris specific fallback strategies.
      The fallback bundles are fetched according to the current session Language.
      Specified by:
      getResourceBundle in interface L10NService
      Returns:
      the bundle
    • getLocalizations

      protected Map<Locale,Properties> getLocalizations()
      Returns:
      localization map where key is a Locale, and value is a instance of Properties
    • getResourceBundle

      public ResourceBundle getResourceBundle(Locale[] locales)
      Description copied from interface: L10NService
      Returns a ResourceBundle for all type localizations. The resource bundle supports hybris specific fallback strategies.
      Fallback bundles are fetched according to the passed locales.
      Specified by:
      getResourceBundle in interface L10NService
      Parameters:
      locales - fallback locales (bundles)
      Returns:
      the bundle
    • getLocalizedString

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

      public String getLocalizedString(String resKey)
      Description copied from interface: L10NService
      Return the localization of an given key and the current session language.
      Specified by:
      getLocalizedString in interface L10NService
      Parameters:
      resKey - the key
      Returns:
      the localized string
    • getResourceBundle

      public ResourceBundle getResourceBundle(String baseName)
      Description copied from interface: L10NService
      Returns a ResourceBundle for a given base name. The resource bundle supports hybris specific fallback strategies.
      The fallback bundles are fetched according to the current session Language.
      Specified by:
      getResourceBundle in interface L10NService
      Parameters:
      baseName - bundle name
      Returns:
      the bundle
    • getResourceBundle

      public ResourceBundle getResourceBundle(String baseName, Locale[] locales)
      Description copied from interface: L10NService
      Returns a ResourceBundle for a given base name. The resource bundle supports hybris specific fallback strategies.
      Fallback bundles are fetched according to the passed locales.
      Specified by:
      getResourceBundle in interface L10NService
      Parameters:
      baseName - bundle name
      locales - fallback locales (bundles)
      Returns:
      the bundle
    • setI18nService

      public void setI18nService(I18NService i18nService)
    • setCommonI18NService

      public void setCommonI18NService(CommonI18NService commonI18NService)
    • setModelService

      public void setModelService(ModelService modelService)