Internationalization kick off#2180
Conversation
4b8280c to
9c0b107
Compare
|
Any comments from the maintiners? Wonder if is there any interest on this :) |
|
I think this would mean enabling the actual test262 tests and tracking progress against them. This looks like a great addition but also something that will need maintenance. |
|
Once working should not be very maintenance demanding. But it will mean adding lots of code. I thought to propose because with the tests already in place and by imitating other engines seems doable. |
|
I've completed the work to bring basic level of Intl support into Jint. The test262 set uses ICU4N package for now, but I'm totally open for better alternatives. There's |
|
I think you refer to #2260. Purpose of this PR was to implement the base functions implementation for locale processing, and that was accomplished by far by the work you provided. Closing this PR for hygiene. Thanks for the follow up :) |
|
I'm sure there's still plenty of things to improve and shaping the API for injecting own implementations. Please don't hesitate to propose improvements, they are valued! |
Description
First major step toward full ECMA-402 internationalization support in Jint by wiring the engine to the ICU (International Components for Unicode) library provided by the host operating system.
What’s included
Implemented Intl.getCanonicalLocales() and CanonicalizeLocaleList() following the ECMA-402 spec.
Added ICU bindings (uloc_forLanguageTag, uloc_canonicalize, uloc_toLanguageTag) to validate, parse, and canonicalize BCP-47 language tags using the system ICU library.
Implemented normalization logic that mirrors WebKit’s behavior (Webkit code is far more readable than v8).
While this PR focuses mainly on Intl.getCanonicalLocales and locale canonicalization, it establishes the foundation for full internationalization support — unlocking future implementation of Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat etc. With the tests already in place, to incrementally implement by fixing is relavely doable.
Number of tests fixed:
Across platform testing:
This was done on windows. Maybe needs testing in other OSs.