Open
Description
Description
Trying to port from next-i18n right now.
Having some trouble with the <Trans />
Component
For e.g. we have a translation like this
"contribute-languages": "All diese Übersetzungen wurden durch die Community ermöglicht. Falls du helfen möchstest bei der Übersetzung von Flathub, <1>tritt dem Flathub Übersetzer-Team bei</1>."
If I try to render it like
<p className="pt-8">
{t.rich("contribute-languages", {
1: (chunks) => (
<a
target="_blank"
rel="noreferrer"
className="no-underline hover:underline"
href="https://hosted.weblate.org/engage/flathub/"
>
{chunks}
</a>
),
})}
</p>
It fails with
Error: INVALID_MESSAGE: UNMATCHED_CLOSING_TAG
at Languages (pages/languages.tsx:45:13)
43 | </ul>
44 | <p className="pt-8">
> 45 | {t.rich("contribute-languages", {
| ^
46 | 1: (chunks) => (
47 | <a
48 | target="_blank" {
code: 'INVALID_MESSAGE',
originalMessage: 'UNMATCHED_CLOSING_TAG'
}
If I change the 1
to t
it starts to work.
Verifications
- I've verified that the problem I'm experiencing isn't covered in the docs.
- I've searched for similar, existing issues on GitHub and Stack Overflow.
- I've compared my app to a working example to look for differences.
Mandatory reproduction URL
https://github.com/razzeee/next-intl-repro
Reproduction description
Steps to reproduce:
- Open page
- See errors in log and nothing is translated
Expected behaviour
It should be translated