Jon Zeppieri <zeppieri@gmail.com>
CLDR is the Common Locale Data Repository, a database of localization information published by the Unicode Consortium.
The CLDR Core library is a Racket interface to the cldr-core JSON distribution published by the Unicode Consortium.
enumerating the set of locales supported by CLDR and testing whether a given locale is supported;
accessing CLDR JSON data; and
canonicalizing locale strings and mapping them to the set of supported CLDR locales.
procedure
( all-locales )→(listofstring? )
procedure
( modern-locales )→(listofstring? )
procedure
( modern-locale? loc)→boolean?
loc:string?
#t
#f
procedure
If fail is a procedure, it is called (through a tail call) with no arguments to produce the result.
Otherwise, fail is returned as the result.
In order to keep download sizes reasonable (since the CLDR data set is very large), packages in the cldr collection keep their data in a .zip file named for the package in question. For example, the cldr-core package contains a data file named cldr-core.zip. This file is a compressed archive of the official distribution.
The cldr-json procedure takes:
the path to this zipfile (typically defined within the package using define-runtime-path );
the name of the package (which doubles as the name of the zipfile, without the .zip extension);
the path within the zipfile to the desired .json file; and
a key used to prune the returned JSON data.
This function is useful for authors of packages within the cldr collection.
value
cldr-main/c :chaperone-contract?
The string argument is a locale name.
(->jsexpr? )
This module provides a high-level interface to the data in likelySubtags.json, described in the CLDR specification.
procedure
locale:string?
"gd"
"root"
procedure
( locale->cldr-locale locale)→cldr-locale?
locale:string?
(cldr-locale "en" "Latn" "US")
(cldr-locale "ar" "Arab" "EG")
(cldr-locale "zh" "Hans" "CN")
procedure
( locale->cldr-language locale)→string?
locale:string?
procedure
( locale->cldr-region locale)→string?
locale:string?
procedure
( locale->cldr-script locale)→string?
locale:string?
struct
#:transparent)lang:string?script:string?region:string?