Documentation
¶
Overview ¶
Command gen writes the data of the Unicode CLDR that package i18n uses, from a pinned release of cldr-json, as Go source: `go generate ./i18n` runs it. It writes tables.go, the plural rules of every language compiled to Go and the parent locales; testdata/plural_samples.txt, the samples CLDR gives of each plural category, which the tests check the compiled rules against; and format_tables.go, what formatting numbers and dates needs of the locales of CLDR's modern coverage (format.go).
The data comes from the npm packages of cldr-json (cldr-core, cldr-dates-full, cldr-numbers-full and cldr-localenames-full), each checked against its SHA-256: no network data reaches the tables unchecked, and generating them again gives the same files.