-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backquote support #57
Comments
The assumption for using template literals is to embed expressions within a string, however, it's not possible for i18next-scanner to find the translation key using static analysis. I can add support for matching back-tick (` `) character, but it would need user's help to specify an option like
i18next.t(`added ${something}`, {
defaultKeys: [
'added foo',
'added bar'
]
});
i18next.t(`added ${something}`, {
defaultKey: {
'something': ['foo', 'bar']
}
}); |
The interpolation mechanism in i18next works well. i18next.t(`added {{something}}
and {{bar}}`, { something: 'foo', bar: 'bar' }); Well, adding this feature may confuse new user especially between the partial template strings support and interpolation. |
Sure. I will update the parser to support back-tick (` `) characters, just to let you know the translation key will have newline characters like below: {
"added {{something}}\n and {{bar}}": ""
} |
Published [email protected] |
It works like a charm. Thank you so much for quick enhancement. |
Version
Configuration
For multiline string, I sometimes use ES6 template strings and it seems i18next-scanner does not support backquote according to the test case.
My test case is:
or even further
Could you please help to add the backquote parsing support?
Thank you.
The text was updated successfully, but these errors were encountered: