i18next-parser
i18next-parser copied to clipboard
useKeysAsDefaultValue broken for Trans component
🐛 Bug Report
When using Trans, default value is populated rather than left as empty string. useDefaultValueAsKeys should result in empty string.
To Reproduce
A codesandbox example or similar or at least steps to reproduce the behavior:
<Trans count={count}>
<div>{'{{ count, INTEGER }}'}</div>
</Trans>
...
useKeysAsDefaultValue: false
Expected behavior
Should generate this:
"<0>{{ count, INTEGER }}</0>_one": "",
"<0>{{ count, INTEGER }}</0>_other": "",
But generates:
"<0>{{ count, INTEGER }}</0>_one": "<0>{{ count, INTEGER }}</0>",
"<0>{{ count, INTEGER }}</0>_other": "<0>{{ count, INTEGER }}</0>",
Your Environment
- runtime version: node 14.17.3
- i18next version: 21.5.4, react-i18next: 11.14.3, i18next-parser: 5.3.0
- os: Mac
- any other relevant information
Will make a sandbox if the template link above is replaced with a link to a forkable sandbox that contains a Terminal rather a list of search results.
Hi, I still face same behavior on version 8.9.0, what is the status of this ticket?
@Fley I have extremely limited bandwidth to code this project. I will review PRs though. If you want this fixed, I invite you to make a PR