- Change
reactjs.org
submodule to your git cloned react.dev. - Change
.env.example
to.env
, and set yourOPENAI_API_KEY
in.env
. - Use
docker-compose run --rm chatgpt sh
run docker. It mountreactjs.org/src/content
to/docs
. - You may neet to run
npm install
in docker shell - Run
ts-node index.ts
to 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.