-
-
Notifications
You must be signed in to change notification settings - Fork 382
Closed as not planned
Closed as not planned
Copy link
Labels
Status: ProposalRequest for commentsRequest for comments
Description
Clear and concise description of the problem
When using Vue I18n with TypeScript, while the injected properties like $t work correctly at runtime, TypeScript shows an error "Cannot find name $t" because these globally injected properties lack proper type definitions.
This creates a poor developer experience in TypeScript projects where we need to either:
- Ignore the TypeScript errors
- Manually declare types for these globals
Suggested solution
We could provide TypeScript type definitions for all globally injected properties ($i18n, $t, $rt, $d, $n, $tm) similar to how other libraries handle this.
A possible implementation would be to:
- Create a type declaration file that defines all the injected i18n properties
- Make it available via
<reference types="vue-i18n/global" />
This feature would significantly improve the developer experience for TypeScript users while maintaining backward compatibility.
Alternative
- Explicitly importing and using the Composer API in every component (but this loses the convenience of implicit injection)
- Manually extending ComponentCustomProperties in each project (not ideal as it requires manual setup)
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
Status: ProposalRequest for commentsRequest for comments