tc39/proposal-intl-locale

Name: proposal-intl-locale

Owner: Ecma TC39

Description: `Intl.Locale` specification [draft]

Created: 2016-10-07 18:59:34.0

Updated: 2018-05-13 23:11:27.0

Pushed: 2018-04-30 15:14:27.0

Homepage: https://tc39.github.io/proposal-intl-locale/

Size: 97

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Intl.Locale API Specification [draft]
Motivation

The JavaScript Intl library (ECMA 402) has used strings to identify locales since the beginning. This works well for many simple cases, and is lightweight and user-friendly. ICU uses a Locale class instead. Defining a Locale class allows the following:

Intl.Locale has a toString method which represents the complete contents of the locale. This method allows Locale instances to be provided as an argument to existing Intl constructors, serialized iN JSON, or any other context where an exact string representation is useful.

Intl.Locale is proposed to be the class that HTML uses to expose the current locale to the Web. Currently, HTML supports only navigator.languages, but with navigator.locales, an Array of Intl.Locale instances, browsers may expose user preferences for calendar, numbering system, and more to Progressive Web applications.

Status

Stage 3

Implementation Progress

Backpointers

Spec

Authors
Reviewers

TBD

Prior Art
Usage
loc = new Intl.Locale("pl-u-hc-h12", {
lendar: 'gregory'

ole.log(loc.language); // "pl"
ole.log(loc.hourCycle); // "h12"
ole.log(loc.calendar); // "gregory"
ole.log(loc.toString()); // "pl-u-ca-gregory-hc-h12"
Render Spec
install
run build
 index.html

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.