Class DefaultI18NService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.servicelayer.i18n.impl.DefaultI18NService
- All Implemented Interfaces:
I18NService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
I18NServiceMock
Default implementation of the i18n service interface.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesLocale[]getAllLocales(Locale locale) Returns a collection of Locales for the passed Locale(Language).
Each Locale element only contains language information and gets constructed from the fallback languages of the passed language.Deprecated, for removal: This API element is subject to removal in a future version.since agesgetBestMatchingJavaCurrency(String isocode) Returns the Currency instance for the given currency iso code.getBestMatchingLocale(Locale locale) For a given locale this method tries to find a matching locale which is backed by a hybris language item.Deprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesgetBundle(String baseName, Locale[] locales, ClassLoader loader) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetCountry(String isocode) Deprecated, for removal: This API element is subject to removal in a future version.since agesgetCurrency(String isoCode) Deprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesreturn a Currency representing the current currency.final LocaleReturns current (session) locale (and not JVM's own locale).Returns current (session) timezone (and not JVM's own timezone).getEnumLocalizedName(HybrisEnumValue enumValue) Deprecated, for removal: This API element is subject to removal in a future version.since agesLocale[]getFallbackLocales(Locale locale) Like getAllLocales(Locale locale) but just return the fallbacks themselvesDeprecated, for removal: This API element is subject to removal in a future version.since agesgetLangPKFromLocale(Locale locale) Returns proper language PK for matching locale.getLanguage(String isocode) Deprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesDeprecated, for removal: This API element is subject to removal in a future version.since agesbooleanReturn the status of the localization fallback flag.Must be overwritten! Use <lookup-method> in spring.voidsetCurrencyDao(CurrencyDao currencyDao) voidsetCurrentCurrency(CurrencyModel currency) Deprecated, for removal: This API element is subject to removal in a future version.since agesvoidsetCurrentJavaCurrency(Currency currency) Sets the current currency.final voidsetCurrentLocale(Locale locale) Changes current session locale.voidsetCurrentTimeZone(TimeZone zone) Changes current session timezone.voidsetEnumLocalizedName(HybrisEnumValue enumValue, String name) Deprecated, for removal: This API element is subject to removal in a future version.since agesvoidsetI18nDao(I18NDao dao) Deprecated, for removal: This API element is subject to removal in a future version.since agesvoidsetLocaleService(LocalizationService localeService) Deprecated, for removal: This API element is subject to removal in a future version.since agesvoidsetLocalizationFallbackEnabled(boolean enabled) Set the status of the localization fallback flag.Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultI18NService
public DefaultI18NService()
-
-
Method Details
-
getTypeService
-
lookupTypeService
Must be overwritten! Use <lookup-method> in spring. -
getCurrentJavaCurrency
Description copied from interface:I18NServicereturn a Currency representing the current currency.- Specified by:
getCurrentJavaCurrencyin interfaceI18NService- Returns:
- the current currency
-
setCurrentJavaCurrency
Description copied from interface:I18NServiceSets the current currency.- Specified by:
setCurrentJavaCurrencyin interfaceI18NService- Parameters:
currency- the new currency
-
getCurrentLocale
Description copied from interface:I18NServiceReturns current (session) locale (and not JVM's own locale).- Specified by:
getCurrentLocalein interfaceI18NService- Returns:
- the current locale
-
setCurrentLocale
Description copied from interface:I18NServiceChanges current session locale.- Specified by:
setCurrentLocalein interfaceI18NService- Parameters:
locale- the new session locale
-
setCurrentTimeZone
Description copied from interface:I18NServiceChanges current session timezone.- Specified by:
setCurrentTimeZonein interfaceI18NService- Parameters:
zone- the new session timezone
-
getCurrentTimeZone
Description copied from interface:I18NServiceReturns current (session) timezone (and not JVM's own timezone).- Specified by:
getCurrentTimeZonein interfaceI18NService- Returns:
- the current time zone
-
isLocalizationFallbackEnabled
public boolean isLocalizationFallbackEnabled()Description copied from interface:I18NServiceReturn the status of the localization fallback flag.The language fallback setting is a session scope setting.
- Specified by:
isLocalizationFallbackEnabledin interfaceI18NService- Returns:
- the status of the localization fallback flag
-
setLocalizationFallbackEnabled
public void setLocalizationFallbackEnabled(boolean enabled) Description copied from interface:I18NServiceSet the status of the localization fallback flag.The language fallback setting is a session scope setting.
- Specified by:
setLocalizationFallbackEnabledin interfaceI18NService- Parameters:
enabled- true if localization fallback should be activated
-
getBestMatchingJavaCurrency
Description copied from interface:I18NServiceReturns the Currency instance for the given currency iso code. If not found, null will be returned.- Specified by:
getBestMatchingJavaCurrencyin interfaceI18NService- Parameters:
isocode- the iso code- Returns:
- the Currency instance for the given currency iso code. If not found, null will be returned
-
getAllLocales
Description copied from interface:I18NServiceReturns a collection of Locales for the passed Locale(Language).
Each Locale element only contains language information and gets constructed from the fallback languages of the passed language.- Specified by:
getAllLocalesin interfaceI18NService- Parameters:
locale- the given locale
-
getBestMatchingLocale
Description copied from interface:I18NServiceFor a given locale this method tries to find a matching locale which is backed by a hybris language item. If the given locale has got country and or variant part and no language can be found for the complete locale the method tries to find a matching locale without variant and, at last, without country. In case not even the language part can be matched a exception is raised since the given locale cannot be used as data locale at all.- Specified by:
getBestMatchingLocalein interfaceI18NService- Parameters:
locale- the locale to match
-
getFallbackLocales
Description copied from interface:I18NServiceLike getAllLocales(Locale locale) but just return the fallbacks themselves- Specified by:
getFallbackLocalesin interfaceI18NService
-
getSupportedJavaCurrencies
- Specified by:
getSupportedJavaCurrenciesin interfaceI18NService- Returns:
- a Set of
Currencys for the current system.
-
getSupportedLocales
- Specified by:
getSupportedLocalesin interfaceI18NService- Returns:
- a Set of
Locales for the current system.
-
setCurrencyDao
-
getLocaleService
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Returns:
- the localeService
-
setLocaleService
@Deprecated(since="ages", forRemoval=true) public void setLocaleService(LocalizationService localeService) Deprecated, for removal: This API element is subject to removal in a future version.since ages- Parameters:
localeService- the localeService to set
-
getI18nDao
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Returns:
- the i18nDao
-
setI18nDao
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Parameters:
dao- the i18nDao to set
-
getCurrentCurrency
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getCurrentCurrencyin interfaceI18NService- Returns:
- the current currency
-
setCurrentCurrency
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
setCurrentCurrencyin interfaceI18NService- Parameters:
currency- the new currency
-
getLanguage
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getLanguagein interfaceI18NService- Parameters:
isocode- the isocode a language is searched for- Returns:
- language for searched isocode
-
getAllActiveLanguages
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getAllActiveLanguagesin interfaceI18NService- Returns:
- all languages where attribute 'active' is set to true
-
getAllLanguages
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getAllLanguagesin interfaceI18NService- Returns:
- all languages in the system
-
getCountry
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getCountryin interfaceI18NService- Parameters:
isocode- the isocode- Returns:
- the country
-
getAllCountries
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getAllCountriesin interfaceI18NService- Returns:
- the countries
-
getAllCurrencies
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getAllCurrenciesin interfaceI18NService- Returns:
- all currencies
-
getBaseCurrency
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getBaseCurrencyin interfaceI18NService- Returns:
- the base currency
-
getCurrency
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getCurrencyin interfaceI18NService- Parameters:
isoCode- the iso code- Returns:
- the CurrencyModel for the given isoCode
-
getSupportedDataLocales
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getSupportedDataLocalesin interfaceI18NService- Returns:
- a Set of
Locales for the current system.
-
getBundle
Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getBundlein interfaceI18NService- Parameters:
baseName- bundle name- Returns:
- the bundle
-
getBundle
@Deprecated(since="ages", forRemoval=true) public ResourceBundle getBundle(String baseName, Locale[] locales) Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getBundlein interfaceI18NService- Parameters:
baseName- bundle namelocales- fallback locales (bundles)- Returns:
- the bundle
-
getBundle
@Deprecated(since="ages", forRemoval=true) public ResourceBundle getBundle(String baseName, Locale[] locales, ClassLoader loader) Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getBundlein interfaceI18NService- Parameters:
baseName- bundle namelocales- fallback locales (bundles)loader- classloader to use- Returns:
- the bundle
-
getEnumLocalizedName
@Deprecated(since="ages", forRemoval=true) public String getEnumLocalizedName(HybrisEnumValue enumValue) Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
getEnumLocalizedNamein interfaceI18NService- Parameters:
enumValue- the value- Returns:
- the enum localized name
-
setEnumLocalizedName
@Deprecated(since="ages", forRemoval=true) public void setEnumLocalizedName(HybrisEnumValue enumValue, String name) Deprecated, for removal: This API element is subject to removal in a future version.since ages- Specified by:
setEnumLocalizedNamein interfaceI18NService- Parameters:
enumValue- the valuename- the new name
-
getLangPKFromLocale
Description copied from interface:I18NServiceReturns proper language PK for matching locale.- Specified by:
getLangPKFromLocalein interfaceI18NService- Parameters:
locale- the locale to get data language code for- Returns:
- language pk
-