You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
DeepL Translate Github Action
v1.0.0
This action uses the DeepL Translate API to translate text files in your repository to your target languages. The output will follow the file extension of the given input file.
Name | Description | Required | Default |
---|---|---|---|
deepl_api_key |
API Key for DeepL API | yes | |
target_languages |
Target languages to translate to | yes | |
input_file_path |
Path of the file you want to translate | yes | |
output_file_name_prefix |
Prefix of the output file name, including folder name | no | |
ignore_terms |
Terms to ignore when translating | no | |
no_translate_start_tag |
Start tag to ignore when translating | no | <!-- notranslate --> |
no_translate_end_tag |
End tag to ignore when translating | no | <!-- /notranslate --> |
How to get DeepL API Token
First, you need to sign up for a DeepL account. Then you can go to https://www.deepl.com/account/summary and retrieve your token there.
If you don't have an existing GitHub Action workflow for your repository
- Create a folder
.github/workflows
if you don't have it already - Inside that folder, create a YAML file say
translate.yml
- In the
translate.yml
file, you can copy the example below and modify it to your usage.
- name: Translate Readme
uses: lyqht/deepl-translate-action@v1
with:
target_languages: 'zh,ja'
input_file_path: 'README.md'
output_file_name_prefix: 'docs/README.'
This will translate the README.md file into Chinese and Japanese, and save them as docs/README.zh.md
and docs/README.ja.md
.
For a demo, refer to this repository deepl-demo.