I asked Zbigniew Braniecki about the status of Intl.NumberFormat.prototype.formatToParts and PluralRules, and he told me,
> Both are ready and need to be exposed. We've been waiting for them to reach > stage 4 to expose them to the Web > NumberFormat.formatToParts is behind the flag - > http://searchfox.org/mozilla-central/source/js/src/builtin/Intl.cpp#1639 > and PluralRules is exposed on mozIntl (which is our chrome-only API for UI > internationalization that extends Intl API) - > http://searchfox.org/mozilla-central/source/toolkit/components/mozintl/mozIntl.js#73 > With you guys having land both I think we can expose them now. I'm happy to > work on the patch next week :) In particular, Mozilla has been pushing these proposals for some time, and has been held back by lack of buy-in from other browser vendors. Dan On Mon, Sep 11, 2017 at 11:32 PM, Adam Klein <[email protected]> wrote: > I have the same question here as my latest question on the PluralRules > thread: any idea why Firefox isn't shipping this (yet), given they have it > implemented? > > On Sun, Sep 10, 2017 at 2:03 PM, Josh Wolfe <[email protected]> wrote: >> >> # Contact emails >> >> [email protected] >> [email protected] >> >> # Spec >> >> https://github.com/tc39/ecma402/pull/79 >> >> # Summary >> >> Intl.NumberFormat.prototype.formatToParts() is scheduled to be added to >> the >> EcmaScript Internationalization API specification (Ecma 402). It adds a >> method >> to format a number to a list of tokens and their types (e.g. minusSign, >> integer, >> decimal, fraction, currency, percentSign, etc). It is implemented and >> disabled >> by default by Firefox. v8 implemented it behind a flag. See also, the >> corresponding DateTimeFormat feature here: >> https://www.chromestatus.com/feature/6319456309477376 >> >> # Motivation >> >> A web form may want to display a price like "$1,234.00" with the >> fractional >> part ".00" in superscript and in a different color. If you use >> Intl.NumberFormat.prototype.format(), you get a string, which you would >> then >> need to parse to find the fractional part. However, the decimal separator >> is >> locale dependent, so attempting to account for this variability somewhat >> defeats the purpose of the locale-independent NumberFormat API. The >> solution is >> to expose the individual parts of the formatted string with tags to >> identify >> each part's role in the overall representation. >> >> # Interoperability risk >> >> * Firefox: In development >> * Edge: No public signals >> * Safari: No public signals >> * Web developers: No signals >> >> # Compatibility risk >> >> Low compatibility risk, as this feature is exposed through a new method >> `Intl.NumberFormat.prototype.formatToParts`. >> >> # Ongoing technical constraints >> >> None >> >> # Will this feature be supported on all six Blink platforms (Windows, Mac, >> Linux, Chrome OS, Android, and Android WebView)? >> >> Yes >> >> # OWP launch tracking bug >> >> https://bugs.chromium.org/p/v8/issues/detail?id=5244 >> >> # Link to entry on the Chrome Platform Status >> >> https://www.chromestatus.com/feature/5686840812109824 >> >> -- >> -- >> v8-users mailing list >> [email protected] >> http://groups.google.com/group/v8-users >> --- You received this message because you are subscribed to the Google >> Groups "v8-users" 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. > > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" 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. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" 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.
