Class DefaultLocaleProvider

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Locale getCurrentDataLocale()
      Returns current (session) data locale to be used to read or store localized attribute data.
      java.util.List<java.util.Locale> getFallbacks​(java.util.Locale requested)
      Returns a List with fallback Locales for the given Locale.
      boolean isFallbackEnabled()
      Returns true if for the current session the Locale fallback is enabled.
      protected I18NService service()  
      java.util.Locale toDataLocale​(java.util.Locale external)
      Converts a arbitrary locale instance into one which is allowed to read and write data with.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultLocaleProvider

        public DefaultLocaleProvider​(I18NService i18NService)
    • Method Detail

      • toDataLocale

        public java.util.Locale toDataLocale​(java.util.Locale external)
        Description copied from interface: LocaleProvider
        Converts a arbitrary locale instance into one which is allowed to read and write data with.
        Specified by:
        toDataLocale in interface LocaleProvider
        Parameters:
        external - the locale
      • getFallbacks

        public java.util.List<java.util.Locale> getFallbacks​(java.util.Locale requested)
        Description copied from interface: LocaleProvider
        Returns a List with fallback Locales for the given Locale.
        Specified by:
        getFallbacks in interface LocaleProvider
        Parameters:
        requested - the Locale for which all fallback Locales are requested.
        Returns:
        null if the locale fallback is not enabled (see LocaleProvider.isFallbackEnabled()).
      • isFallbackEnabled

        public boolean isFallbackEnabled()
        Description copied from interface: LocaleProvider
        Returns true if for the current session the Locale fallback is enabled.
        Specified by:
        isFallbackEnabled in interface LocaleProvider
        Returns:
        false otherwise.