nemo
nemo

Reputation: 151

Add translations string automatically to JSON

My react app have lots of translations strings in it that need to be updated frequently into a JSON file. I'm looking for a way to automate the process so it won't be so tedious.

The best thing will be a small Node script that will run over all my JS files and every time I wrote something like t('example`) it will add it to a JSON file as key and value ({"example":"example"}).

Upvotes: 0

Views: 769

Answers (1)

felixmosh
felixmosh

Reputation: 35473

i18next-scanner does exactly what you've described.

Upvotes: 2

Related Questions