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
DefaultValue option bug #1445
Comments
Sorry, but I don't really get what the problem is. You're using the parseMissingKeyHandler function, and the return value is used. |
So, if you do not like to manipulate the missingKey return value, do not use parseMissingKeyHandler but use missingKeyHandler. |
The documentation says that it will print the value specified, not that it would lookup a fallback translation key. And |
Yes, this is exactly what it is doing. You are returning: Sorry, but I still don't get what the real problem is. |
If you like, we can pass in the default value to the parseMissingKeyHandler function, so you can return that. |
The signature will then be: |
Before; I could pass Now: I get |
I think that would work in our case |
ok, will check if we can do so... |
i18next v21.6.11 should be better for you |
Wow that's fast :) I'll try and let you know.. |
@adrai that works perfectly! Thank you so much <3 |
馃悰 Bug Report
We have a case like this
<Text text={t('.placeholder', { defaultValue: '' })} />
We have a generated form, where translation might, or might not be defined. So we'd like to just print nothing.
This commit/release (20.4.0) changes this behavior, and it will now look for the translation key
''
instead.To Reproduce
Works (v20.3.5)
https://codesandbox.io/s/react-i18next-20-3-5-ok-uxch7
Doesn't work: (v20.4.0)
https://codesandbox.io/s/react-i18next-20-4-0-bug-skq0v
Code to look at:
and
Expected behavior
It should print the string
Fallback
Current behavior
It prints the string from returned from
parseMissingKeyHandler
.Your Environment
The text was updated successfully, but these errors were encountered: