Class DefaultIntegrationLocalizationService

    • Constructor Detail

      • DefaultIntegrationLocalizationService

        public DefaultIntegrationLocalizationService()
    • Method Detail

      • getSupportedLocale

        public java.util.Optional<java.util.Locale> getSupportedLocale​(java.lang.String isoCode)
        Description copied from interface: IntegrationLocalizationService
        Retrieves a locale supported by the platform, which corresponds to the specified ISO code.
        Specified by:
        getSupportedLocale in interface IntegrationLocalizationService
        Parameters:
        isoCode - an ISO code, for which a Locale should be retrieved.
        Returns:
        an Optional containing the Locale, if the ISO code is valid and is supported by the platform; otherwise, Optional.empty() is returned.
      • getSupportedLocaleForLanguageTag

        public final java.util.Locale getSupportedLocaleForLanguageTag​(java.lang.String isoCode)
        Description copied from interface: IntegrationLocalizationService
        Creates a Locale for the provided language tag, and verifies that the locale is supported. Implementations are expected to throw an exception if the langaugeTag is not supported.
        Specified by:
        getSupportedLocaleForLanguageTag in interface IntegrationLocalizationService
        Parameters:
        isoCode - - language tag that holds information used to construct a Locale
        Returns:
        - a supported Locale for the languageTag
      • getDefaultLocale

        public java.util.Locale getDefaultLocale()
        Retrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.
        Specified by:
        getDefaultLocale in interface IntegrationLocalizationService
        Returns:
        the current language locale in the commerce suite, i.e. CommonI18NService.getCurrentLanguage() or Locale.ENGLISH, if current language in the system is null.
      • getInternationalizationService

        protected CommonI18NService getInternationalizationService()
      • setInternationalizationService

        public void setInternationalizationService​(CommonI18NService service)