-
We all know that writing README documentation can be time-consuming, but now there is a solution that can save you half of your time. This is our
action-translate-readme
. -
Translate different language versions of README via
gpt3.5
. -
Automatically submit (commit, push) the translated files through Github Actions (CI/CD).
-
For example: When you write or modify the English version of the README, the translated versions, such as Traditional Chinese, Simplified Chinese, French, etc., are automatically generated.
Note: The translator of v1 version is implemented through third-party packages on Linux
; v2 version is implemented through free openai api called g4f
-
Click ⭐ icon to add this project to your Github repository.
-
Set up your
Github Token
:
-
Create a new
Github Secret Token
- Settings
- Developer settings
- Personal access tokens -
Tokens(classic)
- Generate a new token
- Choose scopes:
repo
andworkflow
- Keep your secret token (do not lose it, you need to paste it later)
-
Create a new
repository secret
- In your repository -
settings
Security and variables
Actions
New repository secret
- Fill in the tag with
token
and name it (e.g.Action_Bot
)
- In your repository -
- Create your action example in the directory
.github/workflows/your_action.yml
. You can just copy the following code:
# .github/workflows/translate.yml
name: Translate Readme
on:
push:
branches: ['**']
jobs:
translate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Auto Translate
uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag
with:
token: ${{ secrets.Action_Bot }} # Based on step2 name
g4f_provider: g4f.Provider.DeepAi # You can change this provider
langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs
There are three parameters to pay special attention to in .yml
:
token
: The token created in the repo based on step 2.g4f_provider
: The provider of gpt, please refer to the link for more information.langs
: The language versions to be generated. Be sure to separate different languages with,
. For example:"en"
: Translate only the English version."en,zh-TW"
: Translate English and Traditional Chinese."French,Arabic"
: Translate French and Arabic.
- Now you can update
README.md
, and it will automatically generate a translated version!
- Check out the test document.
- Use our tool to update the test document.