LLMpediaThe first transparent, open encyclopedia generated by LLMs

Intl (API)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: TC39 Hop 4
Expansion Funnel Raw 64 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted64
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Intl (API)
NameIntl (API)
TitleIntl (API)
AuthorEcma International
Released2012
Latest releaseECMAScript Internationalization API
Programming languageJavaScript
Operating systemCross-platform
GenreLocalization library

Intl (API) The Intl (API) is the ECMAScript Internationalization API that provides language-sensitive string comparison, number formatting, date and time formatting, and plural rules for JavaScript engines. It standardizes locale-aware operations across environments such as Node.js, Chromium, Firefox, Safari, and Deno, enabling web applications, server software, and embedded systems to present culturally appropriate content. The specification grew from work by ECMA International, influenced by standards from Unicode Consortium, IETF, and ISO.

Overview

The API was introduced to align JavaScript with international standards like Unicode CLDR, ECMA-402, and ISO 639-1 to support globalization in platforms such as Google Chrome, Microsoft Edge, and Mozilla Firefox. Major stakeholders include implementers from Apple Inc., Google LLC, Microsoft Corporation, and contributors from W3C and the Unicode Consortium committees. The design balances backward compatibility with the ECMAScript language, coordinating with proposals in TC39 meetings and integrating locale negotiation semantics familiar from BCP 47 and RFC 5646.

Key Components

Intl exposes a set of constructors and objects that map to internationalization tasks. Core components include Intl.NumberFormat, Intl.DateTimeFormat, Intl.Collator, Intl.PluralRules, Intl.RelativeTimeFormat, and Intl.ListFormat. Each component references data from Unicode CLDR, rules in Unicode Technical Standard 35, and identifiers from IETF language tag registries. Implementations rely on underlying libraries such as ICU (International Components for Unicode), or platform-native APIs like Windows Globalization, macOS Foundation, or Android ICU.

Usage and Examples

Developers invoke constructors to create formatters tied to locales like "en-US", "fr-FR", or "zh-Hans-CN". For numbers, Intl.NumberFormat handles currency formats used by entities such as the International Monetary Fund and symbols like those standardized by ISO 4217. Date formatting integrates calendar types referenced in ISO 8601 and cultural calendars such as Japanese calendar or Hebrew calendar used in particular regions. Collation follows sort orders influenced by Latin alphabet conventions, Arabic alphabet reorderings, or locale-specific tailoring used in European Union multilingual applications.

Localization Data and Standards

Intl depends on locale data sourced primarily from the Unicode CLDR project, which aggregates contributions from governments, corporations like Google LLC, IBM, and community groups. Language identifiers use BCP 47 tags, and currency handling references ISO 4217. Pluralization rules follow CLDR plurals derived from Unicode Technical Standard #35, while time zones interact with data from the IANA time zone database used by tz database consumers. The API’s semantics reflect international agreements seen in W3C Internationalization efforts and coordination with IETF working groups.

Implementation and Performance

Most engines thread Intl operations to optimized native code. V8 (JavaScript engine) often delegates to ICU, while SpiderMonkey and JavaScriptCore have their own integrations, and some runtimes embed trimmed CLDR subsets to reduce binary size for embedded devices like Raspberry Pi or mobile platforms such as Android and iOS. Performance characteristics vary: numeric and date formatting can be cached for repeated use, while locale negotiation and loading full CLDR data can affect startup times in environments like Electron or serverless platforms such as AWS Lambda. Polyfills and shims created by projects in the Node.js Foundation ecosystem provide fallbacks for older environments.

Security and Privacy Considerations

Intl operations may reveal user locale, time zone, and numeric or calendar preferences, which can be used for fingerprinting in contexts discussed by researchers at EFF, IETF, and privacy-focused projects like Tor Project. Exposing detailed locale metadata in cross-origin contexts can leak regional settings tied to accounts at services like Google, Facebook, or Twitter. Browser vendors implement mitigations—e.g., reduced-entropy APIs in Firefox and privacy controls in Safari—aligned with guidance from W3C Privacy Interest Group and recommendations from NIST on threat modeling.

Adoption and Browser/Runtime Support

Support for Intl is widespread across modern browsers and runtimes. Google Chrome (via V8), Mozilla Firefox (via SpiderMonkey), Safari (via JavaScriptCore), and Microsoft Edge provide native implementations, while Node.js supports ICU-based or small-icu builds. Polyfills and libraries from communities like npm and projects such as formatjs and Globalize enable broader coverage and supplementary features for legacy environments. Standards evolution is tracked in TC39 proposals and implemented progressively across vendors.

Category:JavaScript libraries