Closed oliviertassinari closed 8 years ago
Actually, it's most likely a regression. I have some new errors in production link to this since the latest release of polyglot.
Indeed, this works in v2.0.0 and is broken in v2.1.0. It seems that I broke it in 4e6fcf80a4286f27cce632dcd39a99584a9cbd2f - I'll get a v2.1.1 out that fixes it ASAP.
v2.1.1 published with the fix. Thanks for the report!
This change introduces different behavior than in 2.0.0
.
It used to be that t('snackbar_error', { message })
with undefined message, would return 'Erreur : %{message}'
(with the expression still included). Now the expression gets replaced with an empty string.
This could be considered breaking, at least it broke a bunch of tests for us.
Thanks, I'll get a fix out asap.
It's unfortunate that null
and undefined
have different behavior than "absent" - that may need to be corrected in v3.
v2.1.2 and v2.2.1 published with the fix.
Thanks so much for the quick fix! ❤
Let's take the following code
and the following key:
It's gonna output
Erreur : foo
whenmessage = foo
But whenmessage = undefined
it's throwing here:I think that it would be better not to crash and to display a warning in the console so we save time digging into it.