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
Messages not being extracted when using React hook only #1633
Comments
yes we right now do not support scraping |
This also applies to the Example (contrived) of code for which the import React from 'react';
import { useIntl } from 'react-intl';
const MyComponent = () => {
const { formatMessage } = useIntl();
const altText = formatMessage({
id: 'page.image.altText',
defaultMessage: 'image text for accessibility',
});
return <img src="/path/to/image.png" alt={altText} />;
}; |
@longlho I don't suppose you have an ETA on this? I'll have a look at the code when I can, but I'm slammed atm. |
I can still reproduce the bug. Example repo.
expected:
|
You need this flag https://formatjs.io/docs/tooling/cli/#--extract-from-format-message-call |
@longlho Has the work you did in 3f14e5d since been reverted or regressed somehow? I have an hours fresh npm install of |
@longlho have an idea why Firefox doesn't recieve the values?. Code example (copy the code to local, the sandbox have different browser implemented): Browser Info: Firefox v72.0.2 (64-bit) |
Which package?
babel-plugin-react-intl
Describe the bug
When I use the React hook for translating my text in components directly the messages do not get extracted.
To Reproduce
Expected behavior
I expected these messages to be extracted in the configured folder (eg. /build/messages/src/...)
Screenshots
n/a
Desktop (please complete the following information):
Additional context
When using the component the messages get extracted successfully.
The text was updated successfully, but these errors were encountered: