Package com.squarespace.cldrengine
Class CLDR
- java.lang.Object
-
- com.squarespace.cldrengine.CLDR
-
public class CLDR extends java.lang.Object
Contains all functionality for a given locale.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<CLocale>
availableLocales()
Return a list of the available locales.java.lang.String
cldrVersion()
Returns the version of the CLDR used by this library.static java.lang.String
compatVersion()
The compatibility version identifies which version of the TypeScript phensley/cldr library this build is compatible with.static SchemaConfig
config()
Return the schema used to configure the library.static CLDR
get(CLocale locale)
Fetch the CLDR instance for the given locale id.static CLDR
get(java.lang.String id)
Fetch the CLDR instance for the given locale id.static CLDR
get(java.util.Locale locale)
Fetch the CLDR instance for the given locale.static LanguageTag
parseLanguageTag(java.lang.String tag)
Parse a locale identifier and resolve it.static CLocale
resolveLocale(LanguageTag tag)
Parse a locale identifier and resolve it.static CLocale
resolveLocale(java.lang.String id)
Parse a locale identifier and resolve it.void
resourcePackLoader(ResourcePackLoader loader)
Set a custom global resource pack loader for the library.
-
-
-
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.
-
-