- Change
reactjs.orgsubmodule to your git cloned react.dev. - Change
.env.exampleto.env, and set yourOPENAI_API_KEYin.env. - Use
docker-compose run --rm chatgpt shrun docker. It mountreactjs.org/src/contentto/docs. - You may neet to run
npm installin docker shell - Run
ts-node index.tsto translate a file in reactjs.org/src/content to the language you selected.
https://github.com/josephMG/chatGPT-translate-docs/blob/main/chatGPT/index.ts#L75-L79
If you want to translate all files in content, remove comment on line 77.
- OPENAI_API_KEY: your openai api key
- CHUNK_TOKENS: chunk your prompt less than this token number
This JSON records these files you translated. if you want to translate all files, just delete it.