Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable casting and Temporal support #635

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rkh
Copy link

@rkh rkh commented Feb 13, 2025

Implements #634

Variable casting

Went for a slightly different API than in the issue.

bundle = new FluentBundle("en-US")

// these aren't needed, as they come built-in, but to illustrate the new API
bundle.addCast("number", FluentNumber)
bundle.addCast(Date, (value: Date) => new FluentDateTime(value.getTime()));

Temporal support

I've put this in a separate package for now, as Temporal is still considered experimental.

It also currently only supports Instant and ZonedDateTime.

Best illustration is probably bundle_test.js.

"license": "Apache-2.0",
"contributors": [
{
"name": "Konstantin Haase",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put myself in here. You can take me out, though. I'm happy to "gift" this little library to Mozilla.

@rkh
Copy link
Author

rkh commented Feb 14, 2025

I am happy to work on the remaining Temporal classes, especially Duration.

We are working on a production app (pre-alpha atm) where we use a Temporal polyfill and Fluent, and we're expecting to use almost all Temporal classes eventually, so I'm also happy to keep an eye on any bugs etc that pop up in the future.

@rkh rkh mentioned this pull request Feb 15, 2025
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.

1 participant