Interface L10NService

All Known Implementing Classes:
DefaultL10NService, DefaultL10NServiceTest.MockDefaultL10NService

public interface L10NService
This service covers the most basic localization functionality like accessing the localized resource bundles and supporting the hybris locale fallback mechanism. See DevNet page "Internationalization and Localization".
Since:
4.3
Spring Bean ID:
l10nService
  • Method Details

    • getResourceBundle

      ResourceBundle getResourceBundle()
      Returns a ResourceBundle for all type localizations which supports hybris specific fallback strategies.
      The fallback bundles are fetched according to the current session Language.
      Returns:
      the bundle
    • getResourceBundle

      ResourceBundle getResourceBundle(Locale[] locales)
      Returns a ResourceBundle for all type localizations. The resource bundle supports hybris specific fallback strategies.
      Fallback bundles are fetched according to the passed locales.
      Parameters:
      locales - fallback locales (bundles)
      Returns:
      the bundle
    • getResourceBundle

      ResourceBundle getResourceBundle(String baseName)
      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.
      Parameters:
      baseName - bundle name
      Returns:
      the bundle
    • getResourceBundle

      ResourceBundle getResourceBundle(String baseName, Locale[] locales)
      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.
      Parameters:
      baseName - bundle name
      locales - fallback locales (bundles)
      Returns:
      the bundle
    • getLocalizedString

      String getLocalizedString(String resKey, 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:
      resKey - the resource key
      arguments - list of values for the text arguments (see MessageFormat.format(String, Object[]))
      Returns:
      the localized string
    • getLocalizedString

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