action-translate-readme
action-translate-readme copied to clipboard
:books:Free GPT-3.5 Generate the README in Multiple Languages via CI/CD
action-translate-readme
- English
- Traditional Chinese Version README.md
- Simplified Chinese
- French
- Arabic
Introduction
[!NOTE] The translator of version
v1is implemented through a third-party package onLinux; versionv2is implemented by calling the OpenAI API for free throughg4f.
-
We all know that writing README documentation takes a lot of time, but now there is a solution that can save you half the time. This is our
action-translate-readme. -
Translate different language versions of README using
gpt3.5. -
Automatically commit (commit, push) the translated files through Github Actions (CI/CD).
-
For example: Write or modify the English version of README, and automatically generate versions of README in Traditional Chinese, Simplified Chinese, French, etc.
How to use?
[!IMPORTANT] Since
gpt3.5is a generative AI model, there is a chance of problems with the translation results each time. It is recommended to use branch testing and try several times.
[!WARNING] If you encounter the following error:
Error: Input required and not supplied: token, please follow step two to ensure that theTokenhas been created or whether theTokenhas expired!
-
Click on the :star: icon to add this project to your Github repository.
-
Set up your
Github Token:-
Create a new
Github Secret Token- Setting
- Developer settings
- Personal access tokens -
Tokens (classic) - Generate new token
- Choose token lifespan - it is recommended to use unlimited
- Choose scopes:
repoandworkflow - Keep your secret token (do not lose it, you will need to paste it later)
-
Create a new
repository secret- In your repository -
settings Securits and variablesActionsNew repository secret- Fill in the label with
tokenand name it (eg:Action_Bot)
- In your repository -
-
-
Create an example of your action in the directory
.github/workflows/your_action.yml. You can directly copy the following:# .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 langsThere are three parameters in
.ymlthat need special attention:token: The token created in the repos based on step 2.g4f_provider: The provider of gpt, for more information, please refer to the linklangs: The language versions you want to generate, 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!
Demo

Results of Test Document
- View the test document
- Use our tool to update the test document
Back to top