I want to extract plain text nodes from react components, just detect it .. add it to file. without using any custom components or so.
currently i thought that’s the default behavior of i18next-parser, but found out after 5 hours of configs and custom scripts, that this isn’t possible by it,
example expectations
<Button variant="white" size="base" onClick={handleClose}>
Cancel // i'd like to extract this without wrapping it in a Trans component
</Button>
<p>
This text should be extractable, it's a normal text node
</p>
is this even possible, workaround?
if it’s not possible then what’s the differance between this package and i18next-scanner!
Adding options to jsx lexer
lexers: {
js: [
{
lexer: 'JsxLexer',
functions: ['t', 't.rich'], // Array of functions to match
transKeepBasicHtmlNodesFor: ['p'],
transSupportBasicHtmlNodes: true,
componentFunctions:[p]
},
],
},
Hazem is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.