I don't seem to be able to get the "unit" to work, new Intl.ListFormat('en', {type: 'unit'}).format(['7','3']) gives me "7, 3"
-
-
-
{ type: 'unit' } doesn’t magically insert units — what units would those be? It just switches to unit formatting, which differs from conjunction/disjunction formatting in some languages (although not in English).
- 2 more replies
New conversation -
-
-
But does yours turn "goose" into "geese"? The one I did a couple years ago doeshttps://github.com/rhroyston/pluralizer-js …
-
That’s a different problem altogether. Intl.PluralRules could help here if you want to do this in a localized manner: https://developers.google.com/web/updates/2017/10/intl-pluralrules …
- 2 more replies
New conversation -
-
-
Is this a needed language feature? Looks like an high level application function for me. What is the reason behind this feature?
-
Did you see the article? It's costly to embed and ship all this localization data in JavaScript code. By exposing these APIs, you no longer need to worry about the localization data; instead, the JavaScript engine provides it for you.
- 4 more replies
New conversation -
-
-
Not a typo. This is how it behaves. The locale data is maintained by Unicode CLDR and it includes the Oxford comma for English. There is an open request to expose multiple styles in the data, which Intl.ListFormat could then use: https://unicode.org/cldr/trac/ticket/11648 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
TIL Unicode prefers the use of the Oxford comma in English.
-
Well that’s THAT debate settled
- 1 more reply
New conversation -
-
-
Is there really a need for such feature directly in JavaScript standard? Seems like standard starts to cover to many things IMO
-
`Intl` features are defined in the Internationalization API Specification, which is separate from the ECMAScript spec: https://tc39.github.io/ecma402/
@v8js (and other JavaScript engines) implement both. - 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
New in