Interface L10NService

  • All Known Implementing Classes:
    DefaultL10NService, SAPMockL10NService

    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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getLocalizedString​(java.lang.String resKey)
      Return the localization of an given key and the current session language.
      java.lang.String getLocalizedString​(java.lang.String resKey, java.lang.Object[] arguments)
      Return the localization of an given key and the current session language.
      java.util.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.
      java.util.ResourceBundle getResourceBundle​(java.lang.String baseName)
      Returns a ResourceBundle for a given base name.
      java.util.ResourceBundle getResourceBundle​(java.lang.String baseName, java.util.Locale[] locales)
      Returns a ResourceBundle for a given base name.
      java.util.ResourceBundle getResourceBundle​(java.util.Locale[] locales)
      Returns a ResourceBundle for all type localizations.
    • Method Detail

      • getResourceBundle

        java.util.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

        java.util.ResourceBundle getResourceBundle​(java.util.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

        java.util.ResourceBundle getResourceBundle​(java.lang.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

        java.util.ResourceBundle getResourceBundle​(java.lang.String baseName,
                                                   java.util.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

        java.lang.String getLocalizedString​(java.lang.String resKey,
                                            java.lang.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

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