Skip to content
JTS

Loading advanced system settings…

Localised country lists without calling any API

Knowledge article · 27 Jul 2026

Source
GitHub · README
Status
Published

Content

Intl.DisplayNames returns the name of any country in any language straight from the browser, with no external dependencies.

The usual approach

For a country picker, the usual move is calling a public API or bundling a huge JSON file of translations. Both bring problems: rate limits, third-party outages, corporate CSP policies blocking the request…

What I use instead

  • Intl.DisplayNames, part of the ECMA-402 standard and available in every browser model-driven apps support, returns the localised name of any region code:
new Intl.DisplayNames(["en"], { type: "region" }).of("DE"); // "Germany"
  • A static array of ISO 3166-1 alpha-2 codes. The list practically never changes, so there is no cost in keeping it inside the control.

Result

Zero configuration, zero network, and the language is picked with a control property. More robust than any external API.

General

Published
27 Jul 2026
Source
GitHub · README
Related project
Country Lookup