Spec
https://tc39.github.io/proposal-intl-list-format
Summary
A Stage 3 proposal that introduces a new formatter under Intl.
Intl.ListFormat helps libraries and frameworks format a list in a
localized fashion by providing internationalized messages using a customary
local word or phrase when available. For example, calling its format()
method with ["Alice", "Bob", "Charlie", "Delta"] would return the string
"Alice, Bob, Charlie and Delta" in English.
Example
let lf = new ListFormat("en");
lf.format(["Alice"]);
// > "Alicce"
lf.format(["Alice", "Bob"]);
// > "Alice and Bob"
lf.format(["Alice", "Bob", "Charlie"]);
// > "Alice, Bob and Charlie"
lf.format(["Alice", "Bob", "Charlie", "Delta"]);
// > "Alice, Bob, Charlie and Delta"
lf = new ListFormat("zh");
lf.format(["譚永鋒"]);
// > "譚永鋒"
lf.format(["譚永鋒", "劉新宇"]);
// > "譚永鋒和劉新宇"
Interoperability and compatibility risk
The Intl.ListFormat is new and should have no risk to break pre-existing
javascript code.
-
Firefox:In development
-
Edge:No public signals
-
Safari:No public signals
-
Web Developers: No public signals
Is this feature fully tested?
Yes; our implementation passes our own V8 tests as well as the Test262
tests for all the features.
Tracking bug
https://crbug.com/v8/7871
Link to entry on the Chrome Platform Status dashboard
https://www.chromestatus.com/features/4764538272481280
Requesting approval to ship?
Yes. Note that since this is a V8/JS feature, this post is just an FYI to
blink-dev — no signoff from Blink API owners is required.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.