vocabhelper
Advanced tools
Changelog
[0.3.0] - 2022-02-13
vocabHelper.extractTranslationString
can now handle translation strings with JSX inside them.
E.g.
const foo = (
<div>
I am a paragraph with some <b>bold</b> text and a <a href="/foo">link</a>
</div>
);
becomes
const foo = (
<div>
{t("I am a paragraph with some bold text and a link", {
b: (children) => <b>{children}</b>,
a: (children) => <a href="/foo">{children}</a>,
})}
</div>
);
// Translation message: "I am a paragraph with some <b>bold</b> text and a <a>link</a>"
vocabHelper.formatAfterReplace
value toggles whether or not to format the document after replacing the highlighted translation string