-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Support different looking Trans props #70
Comments
Sure! I will check how to fine tune this part: const reTrans = new RegExp('<Trans([^]*?)>([^]*?)</\\s*Trans\\s*>', 'gim');
const reTransKey = new RegExp('[^]*i18nKey="([^"]+)"[^]*', 'im'); |
Awesome! while we're on that another great thing would be the ability to have custom component names and key prop name. We, for example, have a wrapper component that looks like this:
It would be great if I could use custom names in that regex for |
FWIW I just submitted PR #71 which changes that code a bit and might make this easier. |
v2.3.1 added context and count options for Trans v2.4.0 added support for using different component name and i18nKey prop: trans: {
component: 'Trans',
i18nKey: 'i18nKey',
extensions: ['.js', '.jsx'],
fallbackKey: true
} |
You rock! |
For parsing the Trans key there are multiple valid ways of doing props:
Could we add those to the regex?
The text was updated successfully, but these errors were encountered: