gilbsgilbs / babel-plugin-i18next-extract

Babel plugin that statically extracts i18next and react-i18next translation keys.
https://i18next-extract.netlify.com
MIT License
161 stars 37 forks source link

Clean up the exporter code to make it easier to use a different expor… #127

Closed pcorpet closed 4 years ago

pcorpet commented 4 years ago

…ter than JSONv3.

FYI, I'm starting a JSONv5 implementation. First to have the last trailing comma, but I'll try to get comments afterwards: comments that were initially in a file, or comments indicating the source of the extraction.

I believe this was the initial purpose of the design (having an easy way to select an exporter).

gilbsgilbs commented 4 years ago

Nice, thanks! You're right, that was totally the intention behind it.

gilbsgilbs commented 4 years ago

FYI, I'm starting a JSONv5 implementation.

Is it a feature that is present in i18next by default? If not, I don't think I want to include it for now. I'd prefer to focus efforts towards #110 so that the maintenance burden can be a little more equally shared. I don't think a middleware MVP for exporters is that far away.

pcorpet commented 4 years ago

Actually i18next does not do the JSON loading, it only gets a dict. The json is usually loaded by webpack or other. So loading some JSON5 is equivalent.

I agree that #110 is the way to go and won't push too much here in the meantime.