We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
contextSeparator
When contextSeparator has been customized, types will be broken when using a t function providing a context.
t
The error will be something like this: Type at position 1 in source is not compatible with type at position 1 in target.
Type at position 1 in source is not compatible with type at position 1 in target.
Your i18n config must have contextSeparator: '|'
contextSeparator: '|'
// the namespace – custom.json
{ "example": "Example", "example|custom": "Example with context" }
// the react component
const { t } = useTranslation(['custom']); // this would result in a type error, `myValue` is `never` const myValue = t('custom:example', { context: 'custom' });
@marcalexiei will open a PR with a fix and an additional test case.
There are no type errors when using a custom contextSeparator. i.e. by adding a way to override the default contextSeparator used by types.
The text was updated successfully, but these errors were encountered:
Should be addressed by @marcalexiei in v23.4.3.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
🐛 Bug Report
When
contextSeparator
has been customized, types will be broken when using at
function providing a context.The error will be something like this:
Type at position 1 in source is not compatible with type at position 1 in target.
To Reproduce
Your i18n config must have
contextSeparator: '|'
// the namespace – custom.json
// the react component
@marcalexiei will open a PR with a fix and an additional test case.
Expected behavior
There are no type errors when using a custom
contextSeparator
.i.e. by adding a way to override the default
contextSeparator
used by types.Your Environment
The text was updated successfully, but these errors were encountered: