Inconsistencies across browser implementations have caused web authors and users headaches since the dawn of time (or at least Jan 1, 1970), but nowhere has that pain been felt more acutely than in the realm of language and regional internationalization and localization.
Let’s take a minute to talk through some of the scenarios which this new internationalization built-in is designed to help solve. Dates, for example, are formatted differently across cultures, and for folks interpreting dates across cultures, this can be confusing. Without proper date localization, we can put people at risk of missing a deadline to apply for a visa, or the date of a plane flight, or the deadline for a bill. It doesn’t stop at dates. These kinds of issues could cause someone to order the wrong amount of a material due to a unit translation error, or pay a price different than expected due to a lack of proper number formatting.
The web is a utility that is increasingly necessary for civic and economic participation in society. If we want to center the rights and safety of people marginalized in our society—immigrants and refugees, folks connecting to the web for the first time—then we have to make sure that the core programming tools we use support diverse locales natively. Building internationalization into the web platform is an issue of social justice.
const date = new Date(Date.UTC(2016, 2, 3, 0, 0, 0)); console.log(new Intl.DateTimeFormat('en-US').format(date)); // “3/2/2016" console.log(new Intl.DateTimeFormat('es-MX').format(date)); // “2/3/2016”
What is in ECMA-402, and why?
ECMA-402 is written and maintained by the same group that writes ECMAScript: Ecma’s Technical Committee 39, or, TC39. Prior to 2019, there was no differentiation within TC39 for work on ECMAScript (the language specification) and Internationalization (the language’s internationalization specification); in March of 2019, TC39-TG1 was created for “General ECMAScript® Language” and TC39-TG2 was created for “ECMAScript® Internationalization API Specification”. New feature proposals come at the recommendation of committee delegates, and are carefully crafted and reviewed by delegates within TG2 over the course of many months (sometimes years), and are subject to the same Staging Process that is used for ECMA-262.
Many of the goals for ECMA-402 were clear from the beginning. If we want a web that serves all language speakers, it is the responsibility of the web platform to provide built-in capabilities that support web authors with this task. The original feature set released in 2012 focused on internationalizing the features that already exist in ECMAScript, such as formatting date and time strings, string comparison for sorting (collation) and number formatting. You can read a summary of all these features at the time of release from ECMA-402’s first editor, Norbert Lindenberg.
A new cycle of ECMA-402 editing
Making 402 More Inclusive
This is the first time we have had more than one editor on ECMA-402, and the first time we have had a project manager on an Ecma specification. We hope that this will help us bring a broader view and better prioritization to the development of the standard. This is also the first time we have had a woman editor for either ECMA-402, or any of the standards maintained by Ecma’s TC39.
Two co-editors at Bocoup are also not native English speakers. Isaac’s first language is Spanish, and Leo’s is Portuguese. In ECMA-402 meetings, and while reading the specification, I can already see how those with foreign language experience are able to bring insightful use cases and perspectives to the issues at hand, influencing specification decisions. I’m thankful to participate in an effort that affords so many learning and teaching opportunities, both with colleagues directly and with the broader web community around the world.
This year the editorial team hopes to discover new ways to help the community request features and communicate their internationalization needs. If you have ideas, please open an issue in our repo and we will actively keep track of it.
Here is a table of feature support – based on Test262 data – separated into three categories: (1) the original feature set of ECMA-402, (2) recently released features and (3) features that are currently undergoing the standardization process and are in the final stage, implementation in browsers. Clicking on the first column will take you the MDN documentation for the feature. A click on any of the cells for features undergoing development, will bring you to the daily updated test262.report page for that feature. There, you can check on the current cross browser status of new features by test pass rates for those features. You should especially take a peak if you are reading this in a few months, or years, from the publishing of this article in May 2019.
|Greater than 90%||You can rely on this feature in this JS engine in standalone applications. Only rely on this feature on the web once support is cross browser. If support is less than 100%, then this engines implementation is not entirely conformant with the standard, so keep an eye out for unusual bugs.|
|Less than 90%||This feature has only been partially implemented and not in conformant with the standard. We do not recommend relying on it.|
|Less than 50%||This feature has not been implemented or it’s implementation is ongoing.|
|Original Feature Set|
|Collation (string sorting)||75%||95%||97%||98%|
|Date and Time Formatting||77%||95%||96%||94%|
|Recently Released Features|
|Date and Time FormatToParts||83%||100%||100%||100%|
|Features In Development|
|Relative Time Formatting||0%||0%||76%||100%|
|Date and Time Ranges Formatting||13%||13%||13%||100%|
|Date and Time `datestyle` and `timestyle` options||0%||0%||0%||100%|
We moved off of Disqus for data privacy and consent concerns, and are currently searching for a new commenting tool.