gen

command
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL