Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Why does this create multiple files? #31

@tuckerconnelly

Description

@tuckerconnelly

Tried this out and it creates a directory structure mirroring the source code structure.

Why not just create a single file? Translators don't care about the source code structure lol.

Also now I have concat every file on the frontend before sending it down to the IntlProvider. A single file would be much better imo.

Edit: What I'm envisioning is, instead of creating an array of objects like this:

[
{ id: 'whatever', defaultMessage: 'message' }
{ id: 'whatever2', defaultMessage: 'another message' }
...
]

babel-plugin-react-intl would automatically generate a flat file for the "en" messages

{ whatever: 'message', whatever2: 'another message' }

So when I'm including messages to pass to I can just import the file generated by babel-plugin-react-intl

import enMessages from './enMessages'
<IntlProvider messages={enMessages} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions