-
-
Notifications
You must be signed in to change notification settings - Fork 488
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: generate Locale
type based on configuration
#3025
feat: generate Locale
type based on configuration
#3025
Conversation
@BobbieGoede To support nuxt-i18n use cases, this could be extended more on the Vue I18n side. e.g. It may be possible to dynamically extend the locale. |
@kazupon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I could work it with vue-i18n v10 latest version!
🔗 Linked issue
❓ Type of change
📚 Description
This changes type generation to narrow the
Locale
type to the configuredlocales
, this way functions that accept alocale
parameter (such as our composables) will have proper autocompletion for all configured locales.@kazupon
There's still an issue/quirk with the type, I'm don't know how to narrow the
locale
property on theComposer
type in the same way, so currently the following would cause a type error:Maybe you know how to resolve this? I don't think this should be merged while this issue is present 😅
Also working on this BobbieGoede#49.
📝 Checklist