i18n-country-translations-data
Localized country name translations in 168 locales — CLDR-sourced, framework-agnostic JSON.
This repository contains the canonical translation data for country and territory names, covering 257 ISO 3166-1 alpha-2 codes across 168 locales. The data is sourced from the Unicode CLDR and stored as flat, human-readable JSON — easy to consume from any language or framework.
Who is this for?
- Library authors building country/locale tools in any language (Python, PHP, Go, Rust, etc.)
- Ruby developers using the i18n-country-translations gem
- JavaScript developers — see the ready-to-use NPM package: i18n-country-translations
- Go developers — import as a Go module with embedded data via i18n-country-translations-go
- Rust developers — available as a crate: i18n-country-translations (repo)
- Elixir developers — available on hex.pm: i18n_country_translations (repo)
- Anyone who needs accurate country names in languages beyond the typical 30-50 that most libraries support
Why 168 locales?
Most translation datasets cover 30-80 major languages and stop there. That leaves hundreds of millions of speakers without support — Punjabi (113M speakers), Telugu (82M), Tamil (78M), Gujarati (56M), Yoruba (45M), and dozens more.
This dataset doesn't cut corners. If CLDR has the data, it's here.
Data Format
Each locale is a single JSON file with flat key-value pairs — no nesting, no complex structure:
// data/de.json
{
"US": "Vereinigte Staaten",
"GB": "Vereinigtes Königreich",
"DE": "Deutschland",
"JP": "Japan",
"NO": "Norwegen"
}Coverage
- 257 territory codes per locale — full ISO 3166-1 alpha-2 plus EU, XK (Kosovo), and other commonly used codes
- 168 locales — from major world languages to regional languages like Basque, Cherokee, and Hawaiian
af, ak, am, ar, as, az, be, bg, bm, bn, bo, br, bs, ca, cs, cy, da, de, dz, ee, el, en, eo, es, et, eu, fa, ff, fi, fo, fr, ga, gd, gl, gu, ha, he, hi, hr, hu, hy, ia, id, ig, is, it, ja, ka, ki, kk, kl, km, kn, ko, ky, lg, ln, lo, lt, lu, lv, mg, mk, ml, mn, mr, ms, mt, my, nb, nd, ne, nl, nn, or, pa, pl, ps, pt, pt-BR, rm, rn, ro, ru, se, sg, si, sk, sl, sn, so, sq, sr, sv, sw, ta, te, th, ti, to, tr, uk, ur, uz, vi, yo, zh, zh-CN, zh-HK, zh-TW, zu, asa, bas, bez, brx, byn, cgg, chr, dav, dje, dyo, ebu, ewo, fil, fur, gsw, guz, haw, jmc, kab, kam, kde, kea, khq, kln, ksb, ksf, ksh, lag, luo, luy, mas, mer, mfe, mgh, mua, naq, nmg, nus, nyn, rof, rwk, saq, sbp, seh, ses, shi, swc, teo, tig, twq, tzm, vai, vun, wae, wal, xog, yav
Repository Structure
data/
en.json # English (reference locale)
de.json # German
ja.json # Japanese
zh-TW.json # Traditional Chinese
... # 168 locale files total
scripts/
validate.js # Validate consistency across all locale files
data.go # Go embed directive
go.mod # Go module definition
Validation
Every locale file is validated to ensure:
- No empty or null values
- Reasonable key count per file
npm run validate
# Validated 168 locale files (en has 258 keys)
# ✓ No critical errorsUsage
Go
import data "github.com/onomojo/i18n-country-translations-data"
// data.FS is an embed.FS containing data/*.jsonRuby
Available as a gem: gem install i18n-country-translations-data
Rust
Available as a crate on crates.io:
# Cargo.toml
[dependencies]
i18n-country-translations = "*"Node.js
Available as an npm package or via the higher-level i18n-country-translations package.
Elixir
Available on hex.pm:
# mix.exs
{:i18n_country_translations, "~> 0.1"}Data Source
All translations come from the Unicode CLDR (Common Locale Data Repository) — the industry-standard source used by every major platform including iOS, Android, Chrome, and Java. This ensures translations are accurate, consistent, and maintained by native speakers through Unicode's established review process.
Related
- i18n-country-translations (NPM) — Ready-to-use JavaScript/TypeScript package built from this data
- i18n-country-translations (Ruby) — Rails gem for country translations
- i18n-country-translations (Go) — Go module for country translations
- i18n-country-translations (Rust) — Rust crate for country translations (crates.io)
- i18n-country-translations (Elixir) — Elixir package for country translations (hex.pm)
- i18n-timezones-data — Timezone name translations (36 locales)
License
MIT