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

Fix: Interview translation types inference #61

Merged
merged 6 commits into from
Oct 2, 2024

Conversation

buckhalt
Copy link
Member

@buckhalt buckhalt commented Sep 19, 2024

Sets up getting type inference when using useTranslations in interview components where the messages aren't predefined and the ids are dynamic.

Accomplished by adding ProtocolMessages type to the IntlMessages type.

Copy link

vercel bot commented Sep 19, 2024

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

Name Status Preview Comments Updated (UTC)
studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:21pm
studio-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:21pm

uses protocol messages schema to infer a type that next-intl uses. replaces generic AbstractIntlMessages with specific types when loading messagess
Copy link
Member

@jthrilly jthrilly left a comment

Choose a reason for hiding this comment

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

Couple of thoughts

also make Prompts extend html div element
Copy link
Member

@jthrilly jthrilly left a comment

Choose a reason for hiding this comment

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

Looks great :)

@jthrilly jthrilly merged commit a132c40 into main Oct 2, 2024
6 checks passed
@jthrilly jthrilly deleted the fix/interview-translation-types branch October 2, 2024 11:08
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