Class DefaultL10NService
- java.lang.Object
-
- de.hybris.platform.servicelayer.i18n.impl.DefaultL10NService
-
- All Implemented Interfaces:
L10NService
public class DefaultL10NService extends java.lang.Object implements L10NService
Default implementation of the l10n service interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultL10NService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.util.Locale,java.util.Properties>getLocalizations()java.lang.StringgetLocalizedString(java.lang.String resKey)Return the localization of an given key and the current session language.java.lang.StringgetLocalizedString(java.lang.String resKey, java.lang.Object[] arguments)Return the localization of an given key and the current session language.java.util.ResourceBundlegetResourceBundle()Returns aResourceBundlefor all type localizations which supports hybris specific fallback strategies.
The fallback bundles are fetched according to the current session Language.java.util.ResourceBundlegetResourceBundle(java.lang.String baseName)Returns aResourceBundlefor a given base name.java.util.ResourceBundlegetResourceBundle(java.lang.String baseName, java.util.Locale[] locales)Returns aResourceBundlefor a given base name.java.util.ResourceBundlegetResourceBundle(java.util.Locale[] locales)Returns aResourceBundlefor all type localizations.voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetI18nService(I18NService i18nService)voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle()
Description copied from interface:L10NServiceReturns aResourceBundlefor all type localizations which supports hybris specific fallback strategies.
The fallback bundles are fetched according to the current session Language.- Specified by:
getResourceBundlein interfaceL10NService- Returns:
- the bundle
-
getLocalizations
protected java.util.Map<java.util.Locale,java.util.Properties> getLocalizations()
- Returns:
- localization map where key is a
Locale, and value is a instance ofProperties
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle(java.util.Locale[] locales)
Description copied from interface:L10NServiceReturns aResourceBundlefor all type localizations. The resource bundle supports hybris specific fallback strategies.
Fallback bundles are fetched according to the passed locales.- Specified by:
getResourceBundlein interfaceL10NService- Parameters:
locales- fallback locales (bundles)- Returns:
- the bundle
-
getLocalizedString
public java.lang.String getLocalizedString(java.lang.String resKey, java.lang.Object[] arguments)Description copied from interface:L10NServiceReturn the localization of an given key and the current session language. The localized string will be processed byMessageFormatusing givenarguments.- Specified by:
getLocalizedStringin interfaceL10NService- Parameters:
resKey- the resource keyarguments- list of values for the text arguments (see MessageFormat.format(String, Object[]))- Returns:
- the localized string
-
getLocalizedString
public java.lang.String getLocalizedString(java.lang.String resKey)
Description copied from interface:L10NServiceReturn the localization of an given key and the current session language.- Specified by:
getLocalizedStringin interfaceL10NService- Parameters:
resKey- the key- Returns:
- the localized string
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle(java.lang.String baseName)
Description copied from interface:L10NServiceReturns aResourceBundlefor 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:
getResourceBundlein interfaceL10NService- Parameters:
baseName- bundle name- Returns:
- the bundle
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle(java.lang.String baseName, java.util.Locale[] locales)Description copied from interface:L10NServiceReturns aResourceBundlefor a given base name. The resource bundle supports hybris specific fallback strategies.
Fallback bundles are fetched according to the passed locales.- Specified by:
getResourceBundlein interfaceL10NService- Parameters:
baseName- bundle namelocales- fallback locales (bundles)- Returns:
- the bundle
-
setI18nService
public void setI18nService(I18NService i18nService)
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
setModelService
public void setModelService(ModelService modelService)
-
-