Skip to content

Support for extracting message and IDs from intl.formatMessage function #38

@tmkasun

Description

@tmkasun
  • version: 1.0.1
  • node version: v10.16.0
  • npm (or yarn) version: 6.9.0

**Do you want to request a feature or report a bug?:

Feature

**What is the current behavior?:

Do not support extracting message text and ID from intl.formatMessage function call

**What is the expected behavior?:

When extracting messages and IDs , Extract them from intl.formatMessage function calls as well

**Suggested solution:

Accept the extractFromFormatMessageCall argument in extract-messages command and pass it to babel-plugin-react-intl through extract-react-intl

So that, When extractFromFormatMessageCall is passed as an argument, It will generate the message text and IDs passed to intl.formatMessage calls.

extractFromFormatMessageCall: Opt-in to extract from intl.formatMessage call with the same restrictions, e.g: has to be called with object literal such as intl.formatMessage({ id: 'foo', defaultMessage: 'bar', description: 'baz'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions