Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: configurable ComponentCustomProperties['$i18n'] type #2094

Merged

Conversation

BobbieGoede
Copy link
Member

Note, I have not tested if this works using the v11 codebase, this is cherry-picked from #2093.


(Copied PR body from #2093 )

This uses the same pattern as the Locale type narrowing, in this case it narrows the $i18n custom component property to either VueI18n or ExportedGlobalComposer but keeps the original behavior (VueI18n | ExportedGlobalComposer) if left unset.

Usage like so:

declare module '@intlify/vue-i18n-core' {
  interface GeneratedTypeConfig {
    legacy: false
  }
}

I wish I looked into this earlier, since the legacy API is going to be removed soon 😅..

Related

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks! 💚

@kazupon kazupon added the Type: Feature Includes new features label Jan 31, 2025
@kazupon kazupon merged commit de2523d into intlify:v11 Jan 31, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants