i18next / react-i18next

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

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

Open Asranov opened 4 months ago

Asranov commented 4 months 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 4 months 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)