├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── biblio.json ├── displaynames.html ├── index.html ├── package.json └── spec.emu /.gitattributes: -------------------------------------------------------------------------------- 1 | index.html -diff merge=ours 2 | spec.js -diff merge=ours 3 | spec.css -diff merge=ours 4 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Deploy spec 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions/setup-node@v1 12 | with: 13 | node-version: '12.x' 14 | - run: npm install 15 | - run: npm run build 16 | - name: commit changes 17 | uses: elstudio/actions-js-build/commit@v3 18 | with: 19 | commitMessage: "fixup: [spec] `npm run build`" 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # Only apps should have lockfiles 40 | yarn.lock 41 | package-lock.json 42 | npm-shrinkwrap.json 43 | pnpm-lock.yaml 44 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 ECMA TC39 and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Proposal: Intl.DisplayNames V2 2 | 3 | ## Stage 4 | Stage 3 5 | 6 | * Advanced to [Stage 1](https://docs.google.com/presentation/d/11Ch4Y9yYzMJjznX478Y0QbbCGiOAXbOzLjpYnMH9eck/edit#slide=id.g98718c7875_0_0) in TC39 2020-09 meeting. 7 | * Advanced to [Stage 2](https://docs.google.com/presentation/d/1Fsr1BhK11rCNgwEMGtwrMq5arpQv2hlEsA2SRiZSTx4/) in [TC39 2021-01-25~28 meeting](https://github.com/tc39/agendas/blob/master/2021/01.md). 8 | * Proposed for [Stage 3](https://docs.google.com/presentation/d/1_BR2bq6gi_i9QjDDluv683cuO2AXNwZl-3hXC4gLl3M/edit) in [TC39 2021 April meeting](https://github.com/tc39/agendas/blob/master/2021/04.md) but not reaching consensus due to [issues related to dialectHandling](https://github.com/tc39/intl-displaynames-v2/issues/29) and [user requests of 'unit' support](https://github.com/tc39/intl-displaynames-v2/issues/2). 9 | * Advanced to [Stage 3](https://docs.google.com/presentation/d/1hxhwHyJLYT32NYrKLTCDLhZHN6OVZEamJppLLlSmyi0) in [TC39 2021-05-25~26 meeting](https://github.com/tc39/agendas/blob/master/2021/05.md). 10 | * Update during [Stage 3](https://docs.google.com/presentation/d/1EUJ8fIBcCN784S_Da5FT8Fxgo1_lVM8InbSUjhuvpkU) in [TC39 2021-07-13~16 meeting](https://github.com/tc39/agendas/blob/master/2021/07.md) 11 | * [Slide for Stage 4 Advacement for TC39 2021-Dec meeting](https://docs.google.com/presentation/d/1bvfdKBVNRUH7J18WGnxR02CKZJ_z3QThp3fLWdMqmzE/) 12 | 13 | 14 | ## Champion 15 | * Frank Tang @FrankYFTang 16 | 17 | ## Reviwers 18 | * Shane Carr @sffc 19 | * Ujjwal Sharma @ryzokuken 20 | 21 | ## Editors 22 | * Richard Gibson @gibson042 23 | 24 | ## Motivation 25 | Main motivation for Intl.DisplayNames project was to enable developers to get translation of language, region or script display names on the client. Translation of languages, regions or script display names requires large amount of data to transmit on the network, which is already available in most browsers. These display name translations also carry steep data size penalty for developers. This API will allow web developers to shrink the size of their HTML and/ or ECMA script code without the need to include the human readable form of display names and therefore reduce the download size to decrease latency. Also, this API will reduce the localization cost for the web developers. Our goal is to expose this data through Intl API for use in e.g. language, region and script pickers, etc. 26 | 27 | In Intl.DisplayNames API, we already cover language, region, script, and currency. This proposal enhance the Intl.DisplayNames API and cover more. 28 | 29 | Please also see prior work of the first version of Intl.DisplayNames on [the Intl.DisplayNames repo](https://github.com/tc39/proposal-intl-displaynames/) 30 | 31 | ## Scoped Enhancements 32 | * Date Time Field 33 | * [Calendar Names](https://github.com/tc39/proposal-intl-displaynames/issues/69) 34 | * Language Display : standard vs dialect 35 | 36 | Changes of scope 37 | * During 2021-01 ECMA402 meeting, we decided not to include Weekday, Month, TimeZone, and Numbering System. 38 | * During 2021-03-11 ECMA402 meeting, we decided to add back dateTimeField. 39 | * During 2021-04-08 ECMA402 meeting, we agree the name of the dialectHandling and proceed to TC39 for Stage 3. Shane and Ujjwal agreed to be Stage 3 reviewers. 40 | * During 2021-05-06 ECMA402 meeting, we agree to drop the "unit" support and rename dialectHandling to languageDisplay. 41 | 42 | ## Examples 43 | 44 | ### Calender Names 45 | ``` 46 | d8> dn = new Intl.DisplayNames("en", {type: "calendar"}) 47 | d8> dn.of("roc") 48 | "Minguo Calendar" 49 | d8> dn.of("persian") 50 | "Persian Calendar" 51 | d8> dn.of("gregory") 52 | "Gregorian Calendar" 53 | d8> dn.of("ethioaa") 54 | "Ethiopic Amete Alem Calendar" 55 | d8> dn.of("japanese") 56 | "Japanese Calendar" 57 | d8> dn.of("dangi") 58 | "Dangi Calendar" 59 | d8> dn.of("chinese") 60 | "Chinese Calendar" 61 | 62 | 63 | d8> dn = new Intl.DisplayNames("zh", {type: "calendar"}) 64 | d8> dn.of("roc") 65 | "民国纪年" 66 | d8> dn.of("persian") 67 | "波斯历" 68 | d8> dn.of("gregory") 69 | "公历" 70 | d8> dn.of("ethioaa") 71 | "埃塞俄比亚阿米特阿莱姆日历" 72 | d8> dn.of("japanese") 73 | "和历" 74 | d8> dn.of("dangi") 75 | "檀纪历" 76 | 8> dn.of("chinese") 77 | "农历" 78 | ``` 79 | 80 | ### Date Time Field Names 81 | ``` 82 | $ out/x64.release/d8 --harmony_intl_displaynames_v2 83 | d8> dn = new Intl.DisplayNames("zh", {type: "dateTimeField"}) 84 | [object Intl.DisplayNames] 85 | d8> dn.of("era") 86 | "纪元" 87 | d8> dn.of("year") 88 | "年" 89 | d8> dn.of("month") 90 | "月" 91 | d8> dn.of("quarter") 92 | "季度" 93 | d8> dn.of("weekOfYear") 94 | "周" 95 | d8> dn.of("weekday") 96 | "工作日" 97 | d8> dn.of("dayPeriod") 98 | "上午/下午" 99 | d8> dn.of("day") 100 | "日" 101 | d8> dn.of("hour") 102 | "小时" 103 | d8> dn.of("minute") 104 | "分钟" 105 | d8> dn.of("second") 106 | "秒" 107 | 108 | d8> dn = new Intl.DisplayNames("es", {type: "dateTimeField"}) 109 | [object Intl.DisplayNames] 110 | d8> dn.of("era") 111 | "era" 112 | d8> dn.of("year") 113 | "año" 114 | d8> dn.of("month") 115 | "mes" 116 | d8> dn.of("quarter") 117 | "trimestre" 118 | d8> dn.of("weekOfYear") 119 | "semana" 120 | d8> dn.of("weekday") 121 | "día de la semana" 122 | d8> dn.of("dayPeriod") 123 | "a. m./p. m." 124 | d8> dn.of("day") 125 | "día" 126 | d8> dn.of("hour") 127 | "hora" 128 | d8> dn.of("minute") 129 | "minuto" 130 | d8> dn.of("second") 131 | "segundo" 132 | ``` 133 | 134 | ### Language Display 135 | ``` 136 | ~/v8/v8$ out/x64.release/d8 --harmony_intl_displaynames_v2 137 | V8 version 9.1.0 (candidate) 138 | d8> dn1 = new Intl.DisplayNames("en", {type: "language"}) 139 | [object Intl.DisplayNames] 140 | d8> dn1.of("en") 141 | "English" 142 | d8> dn1.of("en-GB") 143 | "British English" 144 | d8> dn1.of("en-US") 145 | "American English" 146 | d8> dn1.of("en-AU") 147 | "Australian English" 148 | d8> dn1.of("en-CA") 149 | "Canadian English" 150 | d8> dn1.of("zh") 151 | "Chinese" 152 | d8> dn1.of("zh-Hant") 153 | "Traditional Chinese" 154 | d8> dn1.of("zh-Hans") 155 | "Simplified Chinese" 156 | 157 | // Same as above 158 | d8> dn2 = new Intl.DisplayNames("en", {type: "language", languageDisplay: "dialect"}) 159 | [object Intl.DisplayNames] 160 | d8> dn2.of("en") 161 | "English" 162 | d8> dn2.of("en-GB") 163 | "British English" 164 | d8> dn2.of("en-US") 165 | "American English" 166 | d8> dn2.of("en-AU") 167 | "Australian English" 168 | d8> dn2.of("en-CA") 169 | "Canadian English" 170 | d8> dn2.of("zh") 171 | "Chinese" 172 | d8> dn2.of("zh-Hant") 173 | "Traditional Chinese" 174 | d8> dn2.of("zh-Hans") 175 | "Simplified Chinese" 176 | 177 | // Now switch to standard name 178 | d8> dn3 = new Intl.DisplayNames("en", {type: "language", languageDisplay: "standard"}) 179 | [object Intl.DisplayNames] 180 | d8> dn3.of("en") 181 | "English" 182 | d8> dn3.of("en-GB") 183 | "English (United Kingdom)" 184 | d8> dn3.of("en-AU") 185 | "English (Australia)" 186 | d8> dn3.of("en-CA") 187 | "English (Canada)" 188 | d8> dn3.of("en-US") 189 | "English (United States)" 190 | d8> dn3.of("zh") 191 | "Chinese" 192 | d8> dn3.of("zh-Hant") 193 | "Chinese (Traditional)" 194 | d8> dn3.of("zh-Hans") 195 | "Chinese (Simplified)" 196 | ``` 197 | 198 | ## Discussed Scopes during Stage 1 199 | 200 | * Extending Types: 201 | * ~~[Weekday and Month Names](https://github.com/tc39/proposal-intl-displaynames/issues/75)~~ 202 | * [Unit Names](https://github.com/tc39/proposal-intl-displaynames/issues/34) 203 | * ~~[TimeZone Names](https://github.com/tc39/proposal-intl-displaynames/issues/17)~~ 204 | * [Calendar Names](https://github.com/tc39/proposal-intl-displaynames/issues/69) 205 | * ~~[Numbering System Names](https://github.com/tc39/proposal-intl-displaynames/issues/68)~~ 206 | * ~~Quarter~~ 207 | * ~~Day Period~~ 208 | * ~~Date Time Field~~ 209 | * Enhance Features: 210 | * [Supporing Dialect](https://github.com/tc39/proposal-intl-displaynames/issues/20) 211 | 212 | ## Discussed Scopes during Stage 2 213 | * 2021-03-11: Add back dateTimeField 214 | * 2021-05-06: Remove unit 215 | 216 | ## Entrance Criteria For Stage 3 217 | * All Stage 2 Criterias 218 | * Complete spec text 219 | * Designated reviewers have signed off on the current spec text 220 | * All ECMAScript editors have signed off on the current spec text 221 | 222 | ## Entrance Criteria For Stage 2 223 | * All Stage 1 Criterias 224 | * Initial spec text 225 | 226 | ## Entrance Criteria For Stage 1 227 | 228 | * Identified “champion” who will advance the addition: **DONE- @FrankYFTang** 229 | * Prose outlining the problem or need and the general shape of a solution 230 | * Illustrative examples of usage 231 | * High-level API 232 | * Discussion of key algorithms, abstractions and semantics 233 | * Identification of potential “cross-cutting” concerns and implementation challenges/complexity 234 | * A publicly available repository for the proposal that captures the above requirements: **DONE https://github.com/tc39/intl-displaynames-v2** 235 | 236 | ## Experimentals 237 | * [V8 Prototype](https://chromium-review.googlesource.com/c/v8/v8/+/2924523) 238 | * Implement new types "calendar", "dateTimeField", and "unit" and add dialectHandling option 239 | * [Mozilla Tracking Bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1693575) 240 | -------------------------------------------------------------------------------- /biblio.json: -------------------------------------------------------------------------------- 1 | { 2 | "https://tc39.es/ecma402/": [ 3 | { 4 | "type": "op", 5 | "aoid": "GetOption", 6 | "id": "sec-getoption" 7 | }, 8 | { 9 | "type": "op", 10 | "aoid": "ResolveLocale", 11 | "id": "sec-resolvelocale" 12 | }, 13 | { 14 | "type": "op", 15 | "aoid": "IsWellFormedCurrencyCode", 16 | "id": "sec-iswellformedcurrencycode" 17 | }, 18 | { 19 | "type": "op", 20 | "aoid": "CanonicalizeLocaleList", 21 | "id": "sec-canonicalizelocalelist" 22 | }, 23 | { 24 | "type": "op", 25 | "aoid": "CanonicalizeUnicodeLocaleId", 26 | "id": "sec-canonicalizeunicodelocaleid" 27 | }, 28 | { 29 | "type": "op", 30 | "aoid": "IsStructurallyValidLanguageTag", 31 | "id": "sec-isstructurallyvalidlanguagetag" 32 | }, 33 | { 34 | "type": "op", 35 | "aoid": "SupportedLocales", 36 | "id": "sec-supportedlocales" 37 | }, 38 | { 39 | "type": "op", 40 | "aoid": "IsWellFormedUnitIdentifier", 41 | "id": "sec-iswellformedunitidentifier" 42 | }, 43 | { 44 | "type": "op", 45 | "aoid": "IsValidTimeZoneName", 46 | "id": "sec-isvalidtimezonename" 47 | }, 48 | { 49 | "type": "op", 50 | "aoid": "CanonicalizeTimeZoneName", 51 | "id": "sec-canonicalizetimezonenam" 52 | }, 53 | { 54 | "type": "clause", 55 | "number": "6.1", 56 | "id": "sec-case-sensitivity-and-case-mapping" 57 | }, 58 | { 59 | "type": "term", 60 | "term": "legacy-constructor", 61 | "refId": "sec-constructor-properties-of-the-intl-object", 62 | "id": "legacy-constructor" 63 | }, 64 | { 65 | "type": "clause", 66 | "number": "9.1", 67 | "id": "sec-internal-slots" 68 | }, 69 | { 70 | "type": "clause", 71 | "number": "6.1", 72 | "id": "sec-case-sensitivity-and-case-mapping" 73 | } 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /displaynames.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

DisplayNames Objects

4 | 5 | 6 |

Abstract Operations for DisplayNames Objects

7 | 8 | 9 |

CanonicalCodeForDisplayNames ( _type_, _code_)

10 |

11 | The CanonicalCodeForDisplayNames abstract operation is called with arguments _type_, _code_. It verifies that the _code_ argument represents a well-formed code according to the _type_ argument and returns the case-regularized form of the _code_. The algorithm refers to UTS 35's Unicode Language and Locale Identifiers grammar. The following steps are taken: 12 |

13 | 14 | 1. If _type_ is `"language"`, then 15 | 1. If _code_ does not matches the `unicode_language_id` production, throw a *RangeError* exceptipon. 16 | 1. If IsStructurallyValidLanguageTag(_code_) is *false*, throw a *RangeError* exception. 17 | 1. Set _code_ to CanonicalizeUnicodeLocaleId(_code_). 18 | 1. Return _code_. 19 | 1. If _type_ is `"region"`, then 20 | 1. If _code_ does not matches the `unicode_region_subtag` production, throw a *RangeError* exceptipon. 21 | 1. Let _code_ be the result of mapping _code_ to upper case as described in . 22 | 1. Return _code_. 23 | 1. If _type_ is `"script"`, then 24 | 1. If _code_ does not matches the `unicode_script_subtag` production, throw a *RangeError* exceptipon. 25 | 1. Let _code_ be the result of mapping the first character in _code_ to upper case, and mapping the second, third and fourth character in _code_ to lower case, as described in . 26 | 1. Return _code_. 27 | 1. If _type_ is `"calendar"`, then 28 | 1. If _code_ does not match the Unicode Locale Identifier `type` nonterminal, throw a *RangeError* exception. 29 | 1. Let _code_ be the result of mapping _code_ to lower case as described in . 30 | 1. Return _code_. 31 | 1. If _type_ is `"dateTimeField"`, then 32 | 1. If the result of IsValidDateTimeFieldCode(_code_) is *false*, throw a *RangeError* exception. 33 | 1. Return _code_. 34 | 1. Assert: _type_ is `"currency"`. 35 | 1. If ! IsWellFormedCurrencyCode(_code_) is *false*, throw a *RangeError* exceptipon. 36 | 1. Let _code_ be the result of mapping _code_ to upper case as described in . 37 | 1. Return _code_. 38 | 39 |
40 |
41 | 42 | 43 |

IsValidDateTimeFieldCode ( _field_ )

44 |

45 | 46 | The IsValidDateTimeFieldCode abstract operation is called with argument _field_. It verifies that the _field_ argument represents a valid date time field code. The following steps are taken: 47 | 48 |

49 | 50 | 1. If _field_ is listed in the Code column of , return *true*. 51 | 1. Return *false*. 52 | 53 | 54 | 55 | Codes For Date Time Field of DisplayNames 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
CodeDescription
`"era"`The field indicating the era, e.g. AD or BC in the Gregorian (Julian) calendar.
`"year"`The field indicating the year.
`"quarter"`The field indicating the quarter, e.g. Q2, 2nd quarter, etc.
`"month"`The field indicating the month, e.g. Sep, September, etc.
`"weekOfYear"`The field indicating the week number within the current year.
`"weekday"`The field indicating the day of week, e.g. Tue, Tuesday, etc.
`"day"`The field indicating the day in month.
`"dayPeriod"`The field indicating the day period, either am/pm marker or others, e.g. noon, evening.
`"hour"`The field indicating the hour.
`"minute"`The field indicating the minute.
`"second"`The field indicating the second.
`"timeZoneName"`The field indicating the time zone name, e.g. PDT, Pacific Daylight Time, etc.
112 |
113 | 114 |
115 | 116 | 117 |

The Intl.DisplayNames Constructor

118 | 119 |

120 | The DisplayNames constructor is a standard built-in property of the Intl object.

121 | 122 | 123 |

Intl.DisplayNames ( _locales_, _options_ )

124 | 125 |

126 | When the *Intl.DisplayNames* function is called with arguments _locales_ and _options_, the following steps are taken: 127 |

128 | 129 | 130 | 1. If NewTarget is *undefined*, throw a *TypeError* exception. 131 | 1. Let _displayNames_ be ? OrdinaryCreateFromConstructor(NewTarget, `"%DisplayNamesPrototype%"`, « [[InitializedDisplayNames]], [[Locale]], [[Style]], [[Type]], [[Fallback]], [[LanguageDisplay]], [[Fields]] »). 132 | 1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_). 133 | 1. Let _options_ be ? ToObject(_options_). 134 | 1. Let _opt_ be a new Record. 135 | 1. Let _localeData_ be %DisplayNames%.[[LocaleData]]. 136 | 1. Let _matcher_ be ? GetOption(_options_, `"localeMatcher"`, `"string"`, « `"lookup"`, `"best fit"` », `"best fit"`). 137 | 1. Set _opt_.[[localeMatcher]] to _matcher_. 138 | 1. Let _r_ be ResolveLocale(%DisplayNames%.[[AvailableLocales]], _requestedLocales_, _opt_, %DisplayNames%.[[RelevantExtensionKeys]]). 139 | 1. Let _style_ be ? GetOption(_options_, `"style"`, `"string"`, « `"narrow"`, `"short"`, `"long"` », `"long"`). 140 | 1. Set _displayNames_.[[Style]] to _style_. 141 | 1. Let _type_ be ? GetOption(_options_, `"type"`, `"string"`, « `"language"`, `"region"`, `"script"`, `"currency"` , `"calendar"`, `"dateTimeField"`», *undefined*). 142 | 1. If _type_ is *undefined*, throw a *TypeError* exception. 143 | 1. Set _displayNames_.[[Type]] to _type_. 144 | 1. Let _fallback_ be ? GetOption(_options_, `"fallback"`, `"string"`, « `"code"`, `"none"` », `"code"`). 145 | 1. Set _displayNames_.[[Fallback]] to _fallback_. 146 | 1. Set _displayNames_.[[Locale]] to the value of _r_.[[Locale]]. 147 | 1. Let _dataLocale_ be _r_.[[dataLocale]]. 148 | 1. Let _dataLocaleData_ be _localeData_.[[<_dataLocale_>]]. 149 | 1. Let _types_ be _dataLocaleData_.[[types]]. 150 | 1. Assert: _types_ is a Record (see ). 151 | 1. Let _typeFields_ be _types_.[[<_type_>]]. 152 | 1. Assert: _typeFields_ is a Record (see ). 153 | 1. Let _languageDisplay_ be ? GetOption(_options_, `"languageDisplay"`, `"string"`, « `"dialect"`, `"standard"` », `"dialect"`). 154 | 1. If _type_ is `"language"`, then 155 | 1. Set _displayNames_.[[LanguageDisplay]] to _languageDisplay_. 156 | 1. Let _typeFields_ be _typeFields_.[[<_languageDisplay_>]]. 157 | 1. Assert: _typeFields_ is a Record (see ). 158 | 1. Let _styleFields_ be _typeFields_.[[<_style_>]]. 159 | 1. Assert: _styleFields_ is a Record (see ). 160 | 1. Set _displayNames_.[[Fields]] to _styleFields_. 161 | 1. Return _displayNames_. 162 | 163 |
164 |
165 | 166 | 167 |

Properties of the Intl.DisplayNames Constructor

168 | 169 |

170 | The Intl.DisplayNames constructor has the following properties: 171 |

172 | 173 | 174 |

Intl.DisplayNames.prototype

175 | 176 |

177 | The value of *Intl.DisplayNames.prototype* is *%DisplayNamesPrototype%*. 178 |

179 |

180 | This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }. 181 |

182 |
183 | 184 | 185 |

Intl.DisplayNames.supportedLocalesOf ( _locales_ [ , _options_ ] )

186 | 187 |

188 | When the *supportedLocalesOf* method of *%DisplayNames%* is called, the following steps are taken: 189 |

190 | 191 | 192 | 1. Let _availableLocales_ be *%DisplayNames%*.[[AvailableLocales]]. 193 | 1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_). 194 | 1. Return ? SupportedLocales(_availableLocales_, _requestedLocales_, _options_). 195 | 196 |
197 | 198 | 199 |

Internal slots

200 | 201 |

202 | The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in . 203 |

204 | 205 |

206 | The value of the [[RelevantExtensionKeys]] internal slot is « ». 207 |

208 | 209 |

210 | The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in and the following additional constraints: 211 |

212 | 213 |
    214 |
  • [[LocaleData]].[[<_locale_>]] must have a [[types]] field for all locale values _locale_. The value of this field must be a Record, which must have fields with the names of one of the valid display name types: `"language"`, `"region"`, `"script"`, and `"currency"`, `"calendar"`, and `"dateTimeField"`.
  • 215 |
  • The value of the field `"language"` must be a Record which must have fields with the names of one of the valid language displays: `"dialect"` and `"standard"`.
  • 216 |
  • The language display fields under display name type `"language"` should contain Records which must have fields with the names of one of the valid display name styles: `"narrow"`, `"short"`, and `"long"`.
  • 217 |
  • The value of fields `"language"`, `"region"`, `"script"`, and `"currency"`, `"calendar"`, and `"dateTimeField"` must be a Record which must have fields with the names of one of the valid display name styles: `"narrow"`, `"short"`, and `"long"`.
  • 218 |
  • The display name styles fields under display name type `"language"` should contain Records, with keys corresponding to language codes according to `unicode_language_id` production. The value of these fields must be string values.
  • 219 |
  • The display name styles fields under display name type `"region"` should contain Records, with keys corresponding to region codes. The value of these fields must be string values.
  • 220 |
  • The display name styles fields under display name type `"script"` should contain Records, with keys corresponding to script codes. The value of these fields must be string values.
  • 221 |
  • The display name styles fields under display name type `"currency"` should contain Records, with keys corresponding to currency codes. The value of these fields must be string values.
  • 222 |
  • The display name styles fields under display name type `"calendar"` should contain Records, with keys corresponding to a String value with the `type` given in Unicode Technical Standard 35 for the calendar used for formatting. The value of these fields must be string values.
  • 223 |
  • The display name styles fields under display name type `"dateTimeField"` should contain Records, with keys corresponding to codes listed in . The value of these fields must be string values.
  • 224 |
225 | 226 | 227 | It is recommended that implementations use the locale data provided by the Common Locale Data Repository (available at http://cldr.unicode.org/). 228 | 229 |
230 |
231 | 232 | 233 |

Properties of the Intl.DisplayNames Prototype Object

234 | 235 |

236 | The Intl.DisplayNames prototype object, referred to as *%DisplayNamesPrototype%*, is itself an ordinary object. It is not a Intl.DisplayNames instance, does not have an [[InitializedDisplayNames]] internal slot or any of the other internal slots of Intl.DisplayNames instance objects. 237 |

238 | 239 | 240 |

Intl.DisplayNames.prototype.constructor

241 | 242 |

243 | The initial value of *Intl.DisplayNames.prototype.constructor* is the intrinsic object *%DisplayNames%*. 244 |

245 |
246 | 247 | 248 |

Intl.DisplayNames.prototype[ @@toStringTag ]

249 | 250 |

251 | The initial value of the @@toStringTag property is the string value `"Intl.DisplayNames"`. 252 |

253 |

254 | This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }. 255 |

256 |
257 | 258 | 259 |

Intl.DisplayNames.prototype.of ( _code_ )

260 | 261 |

262 | When the *Intl.DisplayNames.prototype.of* is called with an argument _code_, the following steps are taken: 263 |

264 | 265 | 266 | 1. Let _displayNames_ be *this* value. 267 | 1. If Type(_displayNames_) is not Object, throw a *TypeError* exception. 268 | 1. If _displayNames_ does not have an [[InitializedDisplayNames]] internal slot, throw a *TypeError* exception. 269 | 1. Let _code_ be ? ToString(_code_). 270 | 1. Let _code_ be ? CanonicalCodeForDisplayNames(_displayNames_.[[Type]], _code_). 271 | 1. Let _fields_ be _displayNames_.[[Fields]]. 272 | 1. Let _name_ be _fields_[[<_code_>]]. 273 | 1. If _name_ is not *undefined*, return _name_. 274 | 1. If _displayNames_.[[Fallback]] is `"code"`, return _code_. 275 | 1. Return *undefined*. 276 | 277 |
278 | 279 | 280 |

Intl.DisplayNames.prototype.resolvedOptions ( )

281 | 282 |

283 | This function provides access to the locale and options computed during initialization of the object. 284 |

285 | 286 | 287 | 1. Let _displayNames_ be *this* value. 288 | 1. If Type(_displayNames_) is not Object, throw a *TypeError* exception. 289 | 1. If _displayNames_ does not have an [[InitializedDisplayNames]] internal slot, throw a *TypeError* exception. 290 | 1. Let _options_ be ! ObjectCreate(%ObjectPrototype%). 291 | 1. For each row of , except the header row, in table order, do 292 | 1. Let _p_ be the Property value of the current row. 293 | 1. Let _v_ be the value of _displayNames_'s internal slot whose name is the Internal Slot value of the current row. 294 | 1. If _v_ is not *undefined*, then 295 | 1. Perform ! CreateDataPropertyOrThrow(_options_, _p_, _v_). 296 | 1. Return _options_. 297 | 298 | 299 | 300 | Resolved Options of DisplayNames Instances 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 |
Internal SlotProperty
[[Locale]]`"locale"`
[[Style]]`"style"`
[[Type]]`"type"`
[[Fallback]]`"fallback"`
[[LanguageDisplay]]`"languageDisplay"`
329 |
330 |
331 |
332 | 333 | 334 |

Properties of Intl.DisplayNames Instances

335 | 336 |

337 | Intl.DisplayNames instances are ordinary objects that inherit properties from %DisplayNamesPrototype%. 338 |

339 | 340 |

341 | Intl.DisplayNames instances have an [[InitializedDisplayNames]] internal slot. 342 |

343 | 344 |

345 | Intl.DisplayNames instances also have several internal slots that are computed by the constructor: 346 |

347 | 348 | 357 |
358 |
359 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Intl.DisplayNames v2 Proposal

Stage 3 Draft / December 2, 2021

Intl.DisplayNames v2 Proposal

2244 | 2245 | 2246 |

Introduction

2247 | 2248 |

This proposal enhances the Intl.DisplayNames API and cover more display names for weekday, month, time zone, unit, calendar, numbering system, etc. 2249 | See the README for more context.

2250 |
2251 | 2252 | 2253 | 2254 |

1 DisplayNames Objects

2255 | 2256 | 2257 |

1.1 Abstract Operations for DisplayNames Objects

2258 | 2259 | 2260 |

1.1.1 CanonicalCodeForDisplayNames ( type, code)

2261 |

2262 | The CanonicalCodeForDisplayNames abstract operation is called with arguments type, code. It verifies that the code argument represents a well-formed code according to the type argument and returns the case-regularized form of the code. The algorithm refers to UTS 35's Unicode Language and Locale Identifiers grammar. The following steps are taken: 2263 |

2264 |
  1. If type is "language", then
    1. If code does not matches the unicode_language_id production, throw a RangeError exceptipon.
    2. If IsStructurallyValidLanguageTag(code) is false, throw a RangeError exception.
    3. Set code to CanonicalizeUnicodeLocaleId(code).
    4. Return code.
  2. If type is "region", then
    1. If code does not matches the unicode_region_subtag production, throw a RangeError exceptipon.
    2. Let code be the result of mapping code to upper case as described in 6.1.
    3. Return code.
  3. If type is "script", then
    1. If code does not matches the unicode_script_subtag production, throw a RangeError exceptipon.
    2. Let code be the result of mapping the first character in code to upper case, and mapping the second, third and fourth character in code to lower case, as described in 6.1.
    3. Return code.
  4. If type is "calendar", then
    1. If code does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
    2. Let code be the result of mapping code to lower case as described in 6.1.
    3. Return code.
  5. If type is "dateTimeField", then
    1. If the result of IsValidDateTimeFieldCode(code) is false, throw a RangeError exception.
    2. Return code.
  6. Assert: type is "currency".
  7. If ! IsWellFormedCurrencyCode(code) is false, throw a RangeError exceptipon.
  8. Let code be the result of mapping code to upper case as described in 6.1.
  9. Return code.
2265 |
2266 |
2267 | 2268 | 2269 |

1.2 IsValidDateTimeFieldCode ( field )

2270 |

2271 | 2272 | The IsValidDateTimeFieldCode abstract operation is called with argument field. It verifies that the field argument represents a valid date time field code. The following steps are taken: 2273 | 2274 |

2275 |
  1. If field is listed in the Code column of Table 1, return true.
  2. Return false.
2276 | 2277 |
Table 1: Codes For Date Time Field of DisplayNames
2278 | 2279 | 2280 | 2281 | 2282 | 2283 | 2284 | 2285 | 2286 | 2287 | 2288 | 2289 | 2290 | 2291 | 2292 | 2293 | 2294 | 2295 | 2296 | 2297 | 2298 | 2299 | 2300 | 2301 | 2302 | 2303 | 2304 | 2305 | 2306 | 2307 | 2308 | 2309 | 2310 | 2311 | 2312 | 2313 | 2314 | 2315 | 2316 | 2317 | 2318 | 2319 | 2320 | 2321 | 2322 | 2323 | 2324 | 2325 | 2326 | 2327 | 2328 | 2329 | 2330 | 2331 | 2332 | 2333 | 2334 |
CodeDescription
"era"The field indicating the era, e.g. AD or BC in the Gregorian (Julian) calendar.
"year"The field indicating the year.
"quarter"The field indicating the quarter, e.g. Q2, 2nd quarter, etc.
"month"The field indicating the month, e.g. Sep, September, etc.
"weekOfYear"The field indicating the week number within the current year.
"weekday"The field indicating the day of week, e.g. Tue, Tuesday, etc.
"day"The field indicating the day in month.
"dayPeriod"The field indicating the day period, either am/pm marker or others, e.g. noon, evening.
"hour"The field indicating the hour.
"minute"The field indicating the minute.
"second"The field indicating the second.
"timeZoneName"The field indicating the time zone name, e.g. PDT, Pacific Daylight Time, etc.
2335 |
2336 | 2337 |
2338 | 2339 | 2340 |

1.3 The Intl.DisplayNames Constructor

2341 | 2342 |

2343 | The DisplayNames constructor is a standard built-in property of the Intl object.

2344 | 2345 | 2346 |

1.3.1 Intl.DisplayNames ( locales, options )

2347 | 2348 |

2349 | When the Intl.DisplayNames function is called with arguments locales and options, the following steps are taken: 2350 |

2351 | 2352 |
  1. If NewTarget is undefined, throw a TypeError exception.
  2. Let displayNames be ? OrdinaryCreateFromConstructor(NewTarget, "%DisplayNamesPrototype%", « [[InitializedDisplayNames]], [[Locale]], [[Style]], [[Type]], [[Fallback]], [[LanguageDisplay]], [[Fields]] »).
  3. Let requestedLocales be ? CanonicalizeLocaleList(locales).
  4. Let options be ? ToObject(options).
  5. Let opt be a new Record.
  6. Let localeData be %DisplayNames%.[[LocaleData]].
  7. Let matcher be ? GetOption(options, "localeMatcher", "string", « "lookup", "best fit" », "best fit").
  8. Set opt.[[localeMatcher]] to matcher.
  9. Let r be ResolveLocale(%DisplayNames%.[[AvailableLocales]], requestedLocales, opt, %DisplayNames%.[[RelevantExtensionKeys]]).
  10. Let style be ? GetOption(options, "style", "string", « "narrow", "short", "long" », "long").
  11. Set displayNames.[[Style]] to style.
  12. Let type be ? GetOption(options, "type", "string", « "language", "region", "script", "currency" , "calendar", "dateTimeField"», undefined).
  13. If type is undefined, throw a TypeError exception.
  14. Set displayNames.[[Type]] to type.
  15. Let fallback be ? GetOption(options, "fallback", "string", « "code", "none" », "code").
  16. Set displayNames.[[Fallback]] to fallback.
  17. Set displayNames.[[Locale]] to the value of r.[[Locale]].
  18. Let dataLocale be r.[[dataLocale]].
  19. Let dataLocaleData be localeData.[[<dataLocale>]].
  20. Let types be dataLocaleData.[[types]].
  21. Assert: types is a Record (see 1.4.3).
  22. Let typeFields be types.[[<type>]].
  23. Assert: typeFields is a Record (see 1.4.3).
  24. Let languageDisplay be ? GetOption(options, "languageDisplay", "string", « "dialect", "standard" », "dialect").
  25. If type is "language", then
    1. Set displayNames.[[LanguageDisplay]] to languageDisplay.
    2. Let typeFields be typeFields.[[<languageDisplay>]].
    3. Assert: typeFields is a Record (see 1.4.3).
  26. Let styleFields be typeFields.[[<style>]].
  27. Assert: styleFields is a Record (see 1.4.3).
  28. Set displayNames.[[Fields]] to styleFields.
  29. Return displayNames.
2353 |
2354 |
2355 | 2356 | 2357 |

1.4 Properties of the Intl.DisplayNames Constructor

2358 | 2359 |

2360 | The Intl.DisplayNames constructor has the following properties: 2361 |

2362 | 2363 | 2364 |

1.4.1 Intl.DisplayNames.prototype

2365 | 2366 |

2367 | The value of Intl.DisplayNames.prototype is %DisplayNamesPrototype%. 2368 |

2369 |

2370 | This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 2371 |

2372 |
2373 | 2374 | 2375 |

1.4.2 Intl.DisplayNames.supportedLocalesOf ( locales [ , options ] )

2376 | 2377 |

2378 | When the supportedLocalesOf method of %DisplayNames% is called, the following steps are taken: 2379 |

2380 | 2381 |
  1. Let availableLocales be %DisplayNames%.[[AvailableLocales]].
  2. Let requestedLocales be ? CanonicalizeLocaleList(locales).
  3. Return ? SupportedLocales(availableLocales, requestedLocales, options).
2382 |
2383 | 2384 | 2385 |

1.4.3 Internal slots

2386 | 2387 |

2388 | The value of the [[AvailableLocales]] internal slot is implementation defined within the constraints described in 9.1. 2389 |

2390 | 2391 |

2392 | The value of the [[RelevantExtensionKeys]] internal slot is « ». 2393 |

2394 | 2395 |

2396 | The value of the [[LocaleData]] internal slot is implementation defined within the constraints described in 9.1 and the following additional constraints: 2397 |

2398 | 2399 |
    2400 |
  • [[LocaleData]].[[<locale>]] must have a [[types]] field for all locale values locale. The value of this field must be a Record, which must have fields with the names of one of the valid display name types: "language", "region", "script", and "currency", "calendar", and "dateTimeField".
  • 2401 |
  • The value of the field "language" must be a Record which must have fields with the names of one of the valid language displays: "dialect" and "standard".
  • 2402 |
  • The language display fields under display name type "language" should contain Records which must have fields with the names of one of the valid display name styles: "narrow", "short", and "long".
  • 2403 |
  • The value of fields "language", "region", "script", and "currency", "calendar", and "dateTimeField" must be a Record which must have fields with the names of one of the valid display name styles: "narrow", "short", and "long".
  • 2404 |
  • The display name styles fields under display name type "language" should contain Records, with keys corresponding to language codes according to unicode_language_id production. The value of these fields must be string values.
  • 2405 |
  • The display name styles fields under display name type "region" should contain Records, with keys corresponding to region codes. The value of these fields must be string values.
  • 2406 |
  • The display name styles fields under display name type "script" should contain Records, with keys corresponding to script codes. The value of these fields must be string values.
  • 2407 |
  • The display name styles fields under display name type "currency" should contain Records, with keys corresponding to currency codes. The value of these fields must be string values.
  • 2408 |
  • The display name styles fields under display name type "calendar" should contain Records, with keys corresponding to a String value with the type given in Unicode Technical Standard 35 for the calendar used for formatting. The value of these fields must be string values.
  • 2409 |
  • The display name styles fields under display name type "dateTimeField" should contain Records, with keys corresponding to codes listed in Table 1. The value of these fields must be string values.
  • 2410 |
2411 | 2412 | Note
2413 | It is recommended that implementations use the locale data provided by the Common Locale Data Repository (available at http://cldr.unicode.org/). 2414 |
2415 |
2416 |
2417 | 2418 | 2419 |

1.5 Properties of the Intl.DisplayNames Prototype Object

2420 | 2421 |

2422 | The Intl.DisplayNames prototype object, referred to as %DisplayNamesPrototype%, is itself an ordinary object. It is not a Intl.DisplayNames instance, does not have an [[InitializedDisplayNames]] internal slot or any of the other internal slots of Intl.DisplayNames instance objects. 2423 |

2424 | 2425 | 2426 |

1.5.1 Intl.DisplayNames.prototype.constructor

2427 | 2428 |

2429 | The initial value of Intl.DisplayNames.prototype.constructor is the intrinsic object %DisplayNames%. 2430 |

2431 |
2432 | 2433 | 2434 |

1.5.2 Intl.DisplayNames.prototype[ @@toStringTag ]

2435 | 2436 |

2437 | The initial value of the @@toStringTag property is the string value "Intl.DisplayNames". 2438 |

2439 |

2440 | This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. 2441 |

2442 |
2443 | 2444 | 2445 |

1.5.3 Intl.DisplayNames.prototype.of ( code )

2446 | 2447 |

2448 | When the Intl.DisplayNames.prototype.of is called with an argument code, the following steps are taken: 2449 |

2450 | 2451 |
  1. Let displayNames be this value.
  2. If Type(displayNames) is not Object, throw a TypeError exception.
  3. If displayNames does not have an [[InitializedDisplayNames]] internal slot, throw a TypeError exception.
  4. Let code be ? ToString(code).
  5. Let code be ? CanonicalCodeForDisplayNames(displayNames.[[Type]], code).
  6. Let fields be displayNames.[[Fields]].
  7. Let name be fields[[<code>]].
  8. If name is not undefined, return name.
  9. If displayNames.[[Fallback]] is "code", return code.
  10. Return undefined.
2452 |
2453 | 2454 | 2455 |

1.5.4 Intl.DisplayNames.prototype.resolvedOptions ( )

2456 | 2457 |

2458 | This function provides access to the locale and options computed during initialization of the object. 2459 |

2460 | 2461 |
  1. Let displayNames be this value.
  2. If Type(displayNames) is not Object, throw a TypeError exception.
  3. If displayNames does not have an [[InitializedDisplayNames]] internal slot, throw a TypeError exception.
  4. Let options be ! ObjectCreate(%ObjectPrototype%).
  5. For each row of Table 2, except the header row, in table order, do
    1. Let p be the Property value of the current row.
    2. Let v be the value of displayNames's internal slot whose name is the Internal Slot value of the current row.
    3. If v is not undefined, then
      1. Perform ! CreateDataPropertyOrThrow(options, p, v).
  6. Return options.
2462 | 2463 |
Table 2: Resolved Options of DisplayNames Instances
2464 | 2465 | 2466 | 2467 | 2468 | 2469 | 2470 | 2471 | 2472 | 2473 | 2474 | 2475 | 2476 | 2477 | 2478 | 2479 | 2480 | 2481 | 2482 | 2483 | 2484 | 2485 | 2486 | 2487 | 2488 | 2489 | 2490 | 2491 | 2492 |
Internal SlotProperty
[[Locale]]"locale"
[[Style]]"style"
[[Type]]"type"
[[Fallback]]"fallback"
[[LanguageDisplay]]"languageDisplay"
2493 |
2494 |
2495 |
2496 | 2497 | 2498 |

1.6 Properties of Intl.DisplayNames Instances

2499 | 2500 |

2501 | Intl.DisplayNames instances are ordinary objects that inherit properties from %DisplayNamesPrototype%. 2502 |

2503 | 2504 |

2505 | Intl.DisplayNames instances have an [[InitializedDisplayNames]] internal slot. 2506 |

2507 | 2508 |

2509 | Intl.DisplayNames instances also have several internal slots that are computed by the constructor: 2510 |

2511 | 2512 |
    2513 |
  • [[Locale]] is a String value with the language tag of the locale whose localization is used for formatting.
  • 2514 |
  • [[Style]] is one of the String values "narrow", "short", or "long", identifying the display names style used.
  • 2515 |
  • [[Type]] is one of the String values "language", "region", "script", or "currency", "calendar", or "dateTimeField", identifying the type of the display names requested.
  • 2516 |
  • [[Fallback]] is one of the String values "code", or "none", identifying the fallback return when the system does not have the requested display name.
  • 2517 |
  • [[LanguageDisplay]] is one of the String values "dialect" or "standard", identifying the language display kind. It is only used when [[Type]] has the value "language".
  • 2518 |
  • [[Fields]] is a Record (see 1.4.3) which 2519 | must have fields with keys corresponding to codes according to [[Style]] and, [[Type]], and [[LanguageDisplay]].
  • 2520 |
2521 |
2522 |
2523 |

A Copyright & Software License

2524 | 2525 |

Copyright Notice

2526 |

© 2021 Google, Ecma International

2527 | 2528 |

Software License

2529 |

All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.

2530 | 2531 |

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

2532 | 2533 |
    2534 |
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. 2535 |
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. 2536 |
  5. Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.
  6. 2537 |
2538 | 2539 |

THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2540 | 2541 |
2542 |
-------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "template-for-proposals", 4 | "description": "A repository template for ECMAScript proposals.", 5 | "scripts": { 6 | "start": "npm run build-loose -- --watch", 7 | "build": "npm run build-loose -- --strict", 8 | "build-loose": "ecmarkup --verbose spec.emu index.html" 9 | }, 10 | "homepage": "https://github.com/tc39/template-for-proposals#readme", 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/tc39/template-for-proposals.git" 14 | }, 15 | "license": "MIT", 16 | "devDependencies": { 17 | "ecmarkup": "^7.0.3" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spec.emu: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
 7 | title: Intl.DisplayNames v2 Proposal
 8 | stage: 3
 9 | location: https://tc39.es/intl-displaynames-v2/
10 | copyright: true
11 | contributors: Google, Ecma International
12 | 
13 | 14 | 15 |

Introduction

16 | 17 |

This proposal enhances the Intl.DisplayNames API and cover more display names for weekday, month, time zone, unit, calendar, numbering system, etc. 18 | See the README for more context.

19 |
20 | 21 | 22 | 23 | --------------------------------------------------------------------------------