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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation function fully type-safe not compatible with context #1333
Comments
//cc @JCQuintas |
This is a limitation of the current type declaration, I can try something later today to see if it can be fixed. For now you can work around this by using |
yup, that syntax it's not supported. I'd recommend using this approach instead (for now): t(`type_${context}` as const); |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
try with i18next v22.4.5 |
i18next v23.0.0 will probably not address that yet |
馃悰 Bug Report
A resource with context (
type_male
,type_female
) is not allowed with fully TypeScript-safe use.To Reproduce
Expected behavior
No error.
Your Environment
The text was updated successfully, but these errors were encountered: