-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Trans
context handled differently from t
function
#1729
Comments
should be addressed with v14.0.6 |
wow, thank you for the fast response! |
If you like this module don’t forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project. There are many ways to help this project 🙏 |
I just tried to update my reproduction to 14.0.6 but I still get a different output when I use the https://stackblitz.com/edit/vitejs-vite-9ntmun?file=package.json&terminal=dev |
This test is green: https://github.com/i18next/react-i18next/blob/master/test/trans.render.spec.jsx#L880 |
ahh I know why.... |
That's because of the override of the prefix and suffix here: https://github.com/i18next/react-i18next/blob/master/src/TransWithoutContext.js#L357 but I don't remember why this was done like that... maybe @jamuhl remembers why? |
fyi: I locally just removed to pass the interpolationOverride object to... and all tests are still green... so it may be we can simplify that to no have the interpolation option override? @jamuhl ? |
I just released v14.0.7 that removes the internal interpolationOverride handling... |
Seems to work now, thanks! :) |
🐛 Bug Report
When using a translation with a context and a "fallback" (= key without context) the results for using
t('key', { context: 'non-existing-context' )
and<Trans i18nKey="key" context="non-existing-context" />
.Here I'm using
undefined
and'asdf'
as the context values:If used like this
<Trans i18nKey="key" values={{ context: 'non-existing-context' }} />
the resulting output matches the one fromt(...)
.To Reproduce
https://stackblitz.com/edit/vitejs-vite-dfveac?file=src%2FApp.tsx&terminal=dev
Expected behavior
<Trans context="..." />
should work the same ast('asdf', { context: 'asdf' })
as described in the doc.The text was updated successfully, but these errors were encountered: