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

allow configuration of more metadata fields #80

Closed
mattkime opened this issue Oct 13, 2016 · 3 comments
Closed

allow configuration of more metadata fields #80

mattkime opened this issue Oct 13, 2016 · 3 comments

Comments

@mattkime
Copy link
Contributor

in my current internationalization project i'm focusing on clear communication between translators and devs. it would be helpful if we could define our own metadata fields that would be treated like the description field - copied along with id and defaultMessage into the extracted json files but otherwise unused during rendering. We wish to have a field that specifically references our ticketing system.

The ideal setup would be to make babel-plugin-react-intl configurable so we could define which fields we want treated with metadata, with the default being [ 'description' ].

Having taken a look at the code this appears to be a simple change affecting ~10 lines of code or so. I wanted to start the conversation to see if this would be a welcome change before submitting a pr.

Thoughts?

@ericf
Copy link
Collaborator

ericf commented Oct 13, 2016

Yeah this seems to make sense to make the metadata concept more generic and treat it similar to the description field which has no runtime semantic or impact. Feel free to propose a PR with this idea more fleshed out.

Did you think about parsing your descriptions after they've been extracted and then expanding the object you send to the translators with this additional metadata?

@mattkime
Copy link
Contributor Author

Yes, we could parse the description field and may do that in the short term but intent is more clear if we have separate fields.

I'll follow up with a PR.

@mattkime mattkime mentioned this issue Dec 22, 2016
@ericf
Copy link
Collaborator

ericf commented Dec 29, 2016

Merged #87

@ericf ericf closed this as completed Dec 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants