amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

Unable to render rich text #1291

Closed krakz999 closed 2 months ago

krakz999 commented 2 months ago

Description

When I try to use rich text in storybook, e.g.:

Translation text: "Some text <link>this is the link label</link> end of text"

To be used like this:

{t.rich("text", {
          link: (chunks) => (
              <a className="underline" href={myLink}>
                  {chunks}
              </a>
          ),
 })}

The text is not rendered, only the tag of the text. Even if I render it normally with t("text") it will still render the tag. It works otherwise, it is only an issue in Storybook.

What might be the problem?

Verifications

Mandatory reproduction URL

-

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Click on …
  3. See error: …

Expected behaviour

Should render the translated text

github-actions[bot] commented 2 months ago

Thank you for your report!

Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically.

Templates:

Creating a good bug report takes time.

To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.

Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:

  1. Open reproduction
  2. Click on …
  3. See error: …

Thank you for your understanding!

FAQ **"I've included a reproduction, what is missing?"** This comment might have been added because your reproduction doesn't point to a destination where the issue can be reproduced. Please make sure that the latest changes were saved in the reproduction and that the link is correct.
github-actions[bot] commented 2 months ago

This issue has been automatically closed because it is currently not actionable and has become stale. If the problem persists, please create a new issue.

adam-pattison commented 1 month ago

@krakz999 I am currently facing the same issue. Did you find a solution or a workaround?