Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline Text Not Rendering Correctly in react-i18next" #1767

Open
Asranov opened this issue Jul 16, 2024 · 1 comment
Open

Multiline Text Not Rendering Correctly in react-i18next" #1767

Asranov opened this issue Jul 16, 2024 · 1 comment

Comments

@Asranov
Copy link

Asranov commented Jul 16, 2024

I'm facing an issue where multiline text defined in translations using \n or \n is not displaying with line breaks in React i18next. Instead, the text appears as a single line without breaks when rendered.

@jamuhl
Copy link
Member

jamuhl commented Jul 16, 2024

\n is not a newline in html...use eg. https://react.i18next.com/latest/trans-component#usage-with-simple-html-elements-like-less-than-br-greater-than-and-others-v10.4.0 or replace \n with <br /> and set it as innerHtml (dangerouslySetInnerHtml)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants