i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.21k stars 1.02k forks source link

Interpolation of the `count` prop doesn't work correctly in the Trans component #1719

Closed timwest612 closed 7 months ago

timwest612 commented 7 months ago

🐛 Bug Report

When passing the count prop to a Trans component (with no values prop) the interpolation prefix/suffix change from the default to #$? & ?$#

Including an empty values object in the Trans prop makes it work fine (shown in the example). I'm trying to pinpoint exactly in which version this broke as I noticed it when running a host of upgrades. I'll keep digging but thought I'd put this ticket up sooner rather than later in case it's an obvious fix that I'm missing!

I think it is a similar issue this? https://github.com/i18next/react-i18next/issues/1685

To Reproduce

A Link to codesandbox

Expected behavior

The interpolation for count passed directly as props should be the same as the rest of the i18next behaviour

adrai commented 7 months ago

v14.0.4 should address this

timwest612 commented 7 months ago

@adrai Amazing! Thanks so much, updated and all looks good 👌