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

feat!: Disallow passing null, undefined or boolean as an ICU argument #1561

Merged
merged 6 commits into from
Nov 20, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Nov 19, 2024

These are errors now:

t('message', {value: null});
t('message', {value: undefined});
t('message', {value: false});

If you really want to use such a raw value in a message, you can cast it to a string first:

const value = true;
t('message', {value: String(value)});

Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 8:06am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 8:06am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 8:06am

@amannn amannn changed the title fix: Inline types for unknown messages args feat!: Disallow pass null, undefined or boolean as an ICU argument Nov 19, 2024
@amannn amannn changed the title feat!: Disallow pass null, undefined or boolean as an ICU argument feat!: Disallow passing null, undefined or boolean as an ICU argument Nov 19, 2024
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