Use the ICU LocaleMatcher to implement the BestFitMatcher of ECMA402 in v8 JavaScript engine. ECMA402 defined the BestFitMatcher abstract operation to allow browser implementation to implement a better way to match locale data. UTS35 sec "4.4 Language Matching" details a data driven algorithm to use CLDR. ICU 67.1 (launched in April 2020) comes with an improved icu::LocaleMatcher API and implementation . This document shows how we implement v8's BestFitMatcher to use such API.
The locale which will be enabled by this better locale matcher are locales with less usage. Therefore the risk is smaller for matching for these locale. It will not impact most common use locales since Chrome already ship data for them and are available already. One example is after the launch, the "ab" (Abkhazian ) locale in the past will fallback to system locale- most likely "en" (English), but with this launch it will fallback to "ru" (Russian) because Chrome ship with Russian locale and we know Abkhazian is more likely to use Russian locale than the system locale.
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
No security risk by launching this.
Contact emails
ft...@google.com
Specification
https://tc39.es/ecma402/#sec-bestfitmatcher
Design docs
https://docs.google.com/document/d/1cPGfiihn76yj2iAomKcspPFyLLcnk3WkCiqceBQPQyk/edit#Summary
Use the ICU LocaleMatcher to implement the BestFitMatcher of ECMA402 in v8 JavaScript engine. ECMA402 defined the BestFitMatcher abstract operation to allow browser implementation to implement a better way to match locale data. UTS35 sec "4.4 Language Matching" details a data driven algorithm to use CLDR. ICU 67.1 (launched in April 2020) comes with an improved icu::LocaleMatcher API and implementation . This document shows how we implement v8's BestFitMatcher to use such API.
Blink component
Blink>JavaScript>Internationalization
TAG review
TAG review status
Not applicable
Risks
Interoperability and Compatibility
The locale which will be enabled by this better locale matcher are locales with less usage. Therefore the risk is smaller for matching for these locale. It will not impact most common use locales since Chrome already ship data for them and are available already. One example is after the launch, the "ab" (Abkhazian ) locale in the past will fallback to system locale- most likely "en" (English), but with this launch it will fallback to "ru" (Russian) because Chrome ship with Russian locale and we know Abkhazian is more likely to use Russian locale than the system locale.
Gecko: No signal
WebKit: No signal
Web developers: No signals
Ergonomics
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
Activation
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
Security
No security risk by launching this.
Is this feature fully tested by web-platform-tests?
Yes
Flag name
--harmony_intl_best_fit_matcher
Tracking bug
https://bugs.chromium.org/p/v8/issues/detail?id=7051
Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5407573287108608
Links to previous Intent discussions
Ready for Trial: https://groups.google.com/a/chromium.org/g/blink-dev/c/W7TcX1tSHDI/m/1AthUhEWBAAJ
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOcELL_J7yEvEbV08_Wp_6qVZzNcUx%2B6%3Dd4QBsp16aK%2BvZtEnQ%40mail.gmail.com.
--
On Thu, Jun 10, 2021 at 9:10 AM Frank Tang <ft...@chromium.org> wrote:Contact emails
ft...@google.com
Specification
https://tc39.es/ecma402/#sec-bestfitmatcher
Design docs
https://docs.google.com/document/d/1cPGfiihn76yj2iAomKcspPFyLLcnk3WkCiqceBQPQyk/edit#Summary
Use the ICU LocaleMatcher to implement the BestFitMatcher of ECMA402 in v8 JavaScript engine. ECMA402 defined the BestFitMatcher abstract operation to allow browser implementation to implement a better way to match locale data. UTS35 sec "4.4 Language Matching" details a data driven algorithm to use CLDR. ICU 67.1 (launched in April 2020) comes with an improved icu::LocaleMatcher API and implementation . This document shows how we implement v8's BestFitMatcher to use such API.
Blink component
Blink>JavaScript>Internationalization
TAG review
TAG review status
Not applicable
I think we're relying on the TC39 process here, and for signals below. Presumably this has been accepted by the group, since it's in the spec. :)Risks
Interoperability and Compatibility
The locale which will be enabled by this better locale matcher are locales with less usage. Therefore the risk is smaller for matching for these locale. It will not impact most common use locales since Chrome already ship data for them and are available already. One example is after the launch, the "ab" (Abkhazian ) locale in the past will fallback to system locale- most likely "en" (English), but with this launch it will fallback to "ru" (Russian) because Chrome ship with Russian locale and we know Abkhazian is more likely to use Russian locale than the system locale.
Gecko: No signal
WebKit: No signal
Web developers: No signalsDo we have any indication of a timeline along which other vendors will ship this as well?
The BestFitSupportedLocales abstract operation returns the subset of the provided BCP 47 language priority list requestedLocales for which availableLocales has a matching locale when using the Best Fit Matcher algorithm. Locales appear in the same order in the returned list as in requestedLocales. The steps taken are implementation dependent.
https://tc39.es/ecma402/#annex-implementation-dependent-behaviourThe following aspects of the ECMAScript 2022 Internationalization API Specification are implementation dependent:
Ergonomics
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
Activation
The "best fit" localeMatcher is the default value for all Intl. objects therefore with the launch the behavior will be the default for all ECMA402 operations unless user pass in {localeMatcher: "lookup"} to force the old behavior.
Security
No security risk by launching this.
It's not clear to me what the delta is between information this mechanism reveals about a user's local system, and what's already available via existing i18n APIs.
I think the claim here is that the ordering is defined by Chrome, not the local system, and that the fallback order is going to be the same for all users, regardless of the language they're using Chrome in, and the language preferences they may have adjusted via chrome://settings?
Is this feature fully tested by web-platform-tests?
Yes
Flag name
--harmony_intl_best_fit_matcher
Tracking bug
https://bugs.chromium.org/p/v8/issues/detail?id=7051
Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5407573287108608
Links to previous Intent discussions
Ready for Trial: https://groups.google.com/a/chromium.org/g/blink-dev/c/W7TcX1tSHDI/m/1AthUhEWBAAJ
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
I'm slightly familiar with locale-fitting from the application-developer POV and had some quick non-blocking questions.I see ICU 67.1 introduced some improvements to the LocaleMatcher, and know that BestFitMatcher has flexibility in the UA implementation…Does this matcher implementation handle the 3 operations mentioned here? Namely: macrolanguage replacements, alias replacements, and parent locale resolving.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOcELL_J7yEvEbV08_Wp_6qVZzNcUx%2B6%3Dd4QBsp16aK%2BvZtEnQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/6244e229-c39b-413f-b482-b27f1673acf3n%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXHy%3Dfq9B5-AaA7fcZ210wMjqqQ2ystZuAq1GUXSM1aDJbPSQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw_ta_ckwoFh08EtxEDr%2BoXJeqeRcc-6Yca2DgTSPQMhWQ%40mail.gmail.com.