I’m trying to translate something like this "User {id} payments"
to both English and Hungarian. How can I do it with the t macro with my current setup?
title: (id, i18n) => t(i18n)`userPayments`,
I’m trying to translate something like this "User {id} payments"
to both English and Hungarian. How can I do it with the t macro with my current setup?
title: (id, i18n) => t(i18n)`userPayments`,
2
Answers
The solution in my case was:
Where
values
is:{ id: payment.id }
.The
t
macro does not support variables. You should try using<Trans />
which supports variables and can be helpful in your case.Here is an example code
There are more options here depending on your setup, check https://react.i18next.com/latest/trans-component