i18next / react-i18next

Internationalization for react done right. Using the i18next i18n ecosystem.
https://react.i18next.com
MIT License
9.18k stars 1.02k forks source link

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

Open Asranov opened 1 month ago

Asranov commented 1 month ago

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 commented 1 month ago

\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)