evenchange4 / react-intl.macro

Extract react-intl messages with babel-plugin-macros.
MIT License
37 stars 6 forks source link

Unable to extract plural forms from FormattedMessage component #38

Closed RopoMen closed 5 years ago

RopoMen commented 5 years ago

Result in JSON file does not contain defaultMessage, only id and description. defaultMessage can also be in multiline, see example

<FormattedMessage
              id="app.fooText"
              defaultMessage={`Found {foo, number} {foo, plural, one {foo} other {foos}}`}
              description="Plural foos"
              values={{foo: 1}} />
evenchange4 commented 5 years ago

@RopoMen Thanks for reporting this issue. It should be fixed in v0.3.4.

RopoMen commented 5 years ago

Hi, I tested this also and plural form extraction worked nicely!