Class CLDR


  • public class CLDR
    extends java.lang.Object
    Contains all functionality for a given locale.
    • Field Detail

      • General

        public final General General
      • Calendars

        public final Calendars Calendars
      • Numbers

        public final Numbers Numbers
      • Schema

        public final Schema Schema
      • Units

        public final Units Units
    • Constructor Detail

      • CLDR

        protected CLDR​(CLocale locale,
                       Bundle bundle,
                       java.lang.String cldrVersion)
    • Method Detail

      • resourcePackLoader

        public void resourcePackLoader​(ResourcePackLoader loader)
        Set a custom global resource pack loader for the library.
      • cldrVersion

        public java.lang.String cldrVersion()
        Returns the version of the CLDR used by this library.
      • compatVersion

        public static java.lang.String compatVersion()
        The compatibility version identifies which version of the TypeScript phensley/cldr library this build is compatible with.
      • config

        public static SchemaConfig config()
        Return the schema used to configure the library. This contains arrays of raw identifiers for locales, languages, etc.
      • availableLocales

        public static java.util.List<CLocale> availableLocales()
        Return a list of the available locales.
      • get

        public static CLDR get​(java.lang.String id)
        Fetch the CLDR instance for the given locale id. If not an exact match, the id will be resolved before fetching.
      • get

        public static CLDR get​(CLocale locale)
        Fetch the CLDR instance for the given locale id. If not an exact match, the id will be resolved before fetching.
      • get

        public static CLDR get​(java.util.Locale locale)
        Fetch the CLDR instance for the given locale.
      • resolveLocale

        public static CLocale resolveLocale​(java.lang.String id)
        Parse a locale identifier and resolve it. This returns a Locale object that includes the original id string or tag's compact form, and a resolved LanguageTag.
      • resolveLocale

        public static CLocale resolveLocale​(LanguageTag tag)
        Parse a locale identifier and resolve it. This returns a Locale object that includes the original id string or tag's compact form, and a resolved LanguageTag.
      • parseLanguageTag

        public static LanguageTag parseLanguageTag​(java.lang.String tag)
        Parse a locale identifier and resolve it. This returns a Locale object that includes the original id string or tag's compact form, and a resolved LanguageTag.