i18n-ally
i18n-ally copied to clipboard
Inline viewing for custom component and attributes
I'm working on a React project with react-18next library, in vscode with the extension.
The problem is that there are no options to specify custom component (tag name) and custom attribute.
Currently, inline preview works only if I use t("a.b.c")
notation.
In my project, instead of directly using t()
, I have a reusable component callled <Text />
, which takes the path as prop, and calls t
for me.
<Text translationKey={t("bill.paymentDetails.helperText")} />
{/* works as expected, inline preview shown */}
<Text translationKey="bill.paymentDetails.helperText" />
{/* doesn't work, nothing happens*/}
I added translationKey
to i18n-ally.extract.parsers.html.attributes
(and babel) array in settings.json, but that didn't work
Basically, I want to enable "inline viewing" for custom component and custom attribute name.
It's a web app created using create-react-app, and I'm using plain JavaScript. On mac m1