Stop Translating Strings by Hand: Automate Your i18n Workflow
A step-by-step tutorial for automating translations with react-i18next, i18next-parser, and a translation API. Extract, translate, and commit — no manual work.
You've set up react-i18next. You have English JSON files. Every time you add a new string, you manually copy it to fr.json, de.json, ja.json, open Google Translate in a browser tab, paste, copy, paste back. Maybe you have a spreadsheet somewhere.
This doesn't have to be your life. Here's a 30-minute setup that extracts new strings, translates them via API, and commits the results — no manual translation work required.
The stack
- react-i18next — your i18n framework (already in place)
- i18next-parser — extracts translation keys from source code
- A translation API — to translate extracted strings (we'll use auto18n, but any API works)
- A Node script — ties it together
- CI — runs the script on every PR or merge
Step 1: Extract translation keys automatically
i18next-parser scans your source code and pulls out every t('key') call into JSON files.