kas-catholic / confessit-web

Source code for https://confessit.app
MIT License
18 stars 7 forks source link

make sure nodes in `Trans` components are simple #63

Closed JohnRDOrazio closed 11 months ago

JohnRDOrazio commented 11 months ago

Any nodes within Trans components that have attributes, or are nested, or do not have just text nodes as children, will be converted to indexed nodes ( see https://react.i18next.com/latest/trans-component#usage-with-simple-html-elements-like-less-than-br-greater-than-and-others-v10.4.0 ).

Examples of elements that will be readable in translation strings: * `
` * `bold` * `

some paragraph

` Examples that will be converted to indexed nodes: * ``: no attributes allowed * `{{name}}`: only text nodes allowed * `bold italic`: no nested elements, even simple ones
JohnRDOrazio commented 11 months ago

I defined a new component githubicon, which will probably need to be added to i18next-scanner configuration...