Skip to content

Refactor @messageformat/icu-messageformat-1#447

Merged
eemeli merged 7 commits intomainfrom
mf2-icu
Mar 24, 2025
Merged

Refactor @messageformat/icu-messageformat-1#447
eemeli merged 7 commits intomainfrom
mf2-icu

Conversation

@eemeli
Copy link
Member

@eemeli eemeli commented Mar 24, 2025

The accessor getMF1Functions() is replaced with a static MF1Functions, which contains an expanded set of MF1 compatibility functions; most of these wrap default or draft MF2 spec functions.

A validator mf1Validate() is provided. This is not run during mf1ToMessage(), though, as the functions now validate their options at runtime (this provides for better fallback).

MF1 syntax support is extended, so datetime & number skeletons + number patterns are now supported. As the MF2 option bags do not provide all of the same features, a best effort is made to match the input. The number format scale/dddd token is specifically supported, however, as it's often required for percentage formatting.

@eemeli eemeli added the MF2 MessageFormat 2 label Mar 24, 2025
@eemeli eemeli merged commit bf3cb36 into main Mar 24, 2025
10 checks passed
@eemeli eemeli deleted the mf2-icu branch March 24, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MF2 MessageFormat 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant