Intent to ship: Intl.ListFormat

55 views
Skip to first unread message

Frank Tang

unread,
Nov 7, 2018, 7:20:30 PM11/7/18
to v8-u...@googlegroups.com, v8-...@googlegroups.com, blin...@chromium.org, Frank Yung-Fong Tang, Sathya Gunasekaran, Felipe Balbontín, Nebojša Ćirić

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.



Sathya Gunasekaran

unread,
Nov 8, 2018, 5:44:15 AM11/8/18
to ft...@chromium.org, v8-u...@googlegroups.com, v8-...@googlegroups.com, blin...@chromium.org, Frank Yung-Fong Tang, Felipe Balbontín, Nebojša Ćirić
LGTM

Mathias Bynens

unread,
Nov 8, 2018, 12:16:08 PM11/8/18
to v8-...@googlegroups.com, ft...@chromium.org, v8-u...@googlegroups.com, blin...@chromium.org, Frank Yung-Fong Tang, Felipe Balbontín, Nebojša Ćirić
LGTM2

--
--
v8-dev mailing list
v8-...@googlegroups.com
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 v8-dev+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Klein

unread,
Nov 8, 2018, 3:01:46 PM11/8/18
to Mathias Bynens, v8-...@googlegroups.com, ft...@chromium.org, v8-u...@googlegroups.com, blin...@chromium.org, Frank Yung-Fong Tang, Felipe Balbontín, Nebojša Ćirić
LGTM3

You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADizRgYSZ0q81co3mW60DypEJZ%2B0GMdM_yphJa4_YcWRfvx-ZQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages