Skip to content

Internationalization kick off#2180

Closed
LuisMerinoP wants to merge 4 commits into
sebastienros:mainfrom
LuisMerinoP:internationalization-kick-off
Closed

Internationalization kick off#2180
LuisMerinoP wants to merge 4 commits into
sebastienros:mainfrom
LuisMerinoP:internationalization-kick-off

Conversation

@LuisMerinoP

@LuisMerinoP LuisMerinoP commented Sep 28, 2025

Copy link
Copy Markdown
Contributor

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:

main branch this branch
✅ Passed 54 396
❌ Failed 2418 2076

Across platform testing:

This was done on windows. Maybe needs testing in other OSs.

@LuisMerinoP
LuisMerinoP marked this pull request as ready for review September 28, 2025 02:56
@LuisMerinoP
LuisMerinoP force-pushed the internationalization-kick-off branch from 4b8280c to 9c0b107 Compare September 28, 2025 03:38
@LuisMerinoP

Copy link
Copy Markdown
Contributor Author

Any comments from the maintiners? Wonder if is there any interest on this :)
@lahma , @sebastienros?
Thanks

@LuisMerinoP

Copy link
Copy Markdown
Contributor Author

Since there is no interest in moving this along, regarding #1445 and #2018 my assumption is that neither the Intl object nor the Temporal API will be supported anytime soon.

@lahma

lahma commented Jan 1, 2026

Copy link
Copy Markdown
Collaborator

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.

@LuisMerinoP

Copy link
Copy Markdown
Contributor Author

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.

@lahma

lahma commented Jan 24, 2026

Copy link
Copy Markdown
Collaborator

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 ICldrProvider interface to allow injecting a better option and also the current default implementation DefaultCldrProvider is quite heavily English only. There's now a lot of tests enabled which should help with fine-tuning the solution and all the APIs involved.

@LuisMerinoP

Copy link
Copy Markdown
Contributor Author

I think you refer to #2260.
Thats huge improvement towards internazionalization support !

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 :)

@lahma

lahma commented Jan 25, 2026

Copy link
Copy Markdown
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants