一键导入
cldr-generator
Understand, run, or update the CLDR data generation pipeline that produces internal/cldr/data.go.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Understand, run, or update the CLDR data generation pipeline that produces internal/cldr/data.go.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | cldr-generator |
| description | Understand, run, or update the CLDR data generation pipeline that produces internal/cldr/data.go. |
This skill provides guidance on how to run, update, and debug the CLDR (Common Locale Data Repository) Go code generator in this project.
The internal/gen tool processes raw XML files from the .cldr directory and compiles them into a single optimized Go source file data.go. It deduplicates all localized string tokens into a single read-only constant string (data), which is sliced at runtime without memory allocation.
The generation pipeline works in three distinct phases:
common/main concurrently using goroutines."" or "contributed").CLDR structures use inheritance to avoid redundancy. The generator resolves and merges this data:
root -> base languages like en -> region/territory sub-locales like en-US).generic calendar date/time formatting options into persian and buddhist calendars.To avoid runtime allocations and keep the binary footprint small:
data in data.go.data[start:end]). Since string slicing does not allocate in Go, this yields zero allocations at runtime.When modifying locale formatting or adding a new locale fallback, use the following sequence:
Modify XML or Generator Code:
Run Code Generation:
earth +generate
go run ./internal/gen -cldr-dir .cldr -out .
Verify Changes:
earth +test
lv):
go test -run=TestDateTime_Format/lv .