This is a tool to translate the language in Markdown files.
You will need and OpenAI API key to use this tool.
We have a stable version on PyPi, so you can install it with pip:
$ pip install gpt-translate
or to get latest version from the repo:
$ cd gpt_translate
$ pip install .
We use GPT4 by default. You can change this on configs/model_config.yaml
You can add new languages by providing the language translation dictionaries in
configs/language_dicts
Export your OpenAI API key:
export OPENAI_API_KEY=aa-proj-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
To translate a single file:
$ gpt_translate.file README.md README_es_.md --language es
to translate a full folder recursively:
$ gpt_translate.folder docs docs_ja --language ja
If you don't know what to do, you can always do:
$ gpt_translate --help
If you have any trouble with the installation, you can always pass the --debug
flag to get more information about what is happening:
$ gpt_translate.folder docs docs_ja --language ja --debug
this will get you a very verbose output (calls to models, inputs and outputs, etc.)