feat: add auto translate readme

pull/14585/head
Bai 2024-12-05 13:00:11 +08:00 committed by 老广
parent ff0f9eb6eb
commit a46a81d477
2 changed files with 30 additions and 8 deletions

View File

@ -1,20 +1,40 @@
name: Translate README.md
name: Translate README
on:
workflow_dispatch:
inputs:
languages:
description: "Target languages"
target_langs:
description: "Target Languages"
required: false
default: "zh-hans,zh-hant,ja,pt-br"
gen_dir_path:
description: "Generate Dir Name"
required: false
default: "readmes/"
push_branch:
description: "Push Branch"
required: false
default: "pr@dev@translate_readme"
prompt:
description: "AI Translate Prompt"
required: false
default: "Do not translate any content under the ## License section.\nKeep all content, Only delete the first line below [//]: # (Language navigation)."
gpt_mode:
description: "GPT Mode"
required: false
default: "gpt-4o-mini"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Auto Translate
uses: BaiJiangJie/translate-readme@main
with:
gpt_token: ${{ secrets.GPT_API_TOKEN }}
gpt_mode: 'gpt-4o-mini'
target_languages: ${{ github.event.inputs.languages }}
env:
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
OPENAI_API_KEY: ${{ secrets.GPT_API_TOKEN }}
GPT_MODE: ${{ github.event.inputs.gpt_mode }}
TARGET_LANGUAGES: ${{ github.event.inputs.target_langs }}
PUSH_BRANCH: ${{ github.event.inputs.push_branch }}
GEN_DIR_PATH: ${{ github.event.inputs.gen_dir_path }}
PROMPT: ${{ github.event.inputs.prompt }}

View File

@ -10,7 +10,9 @@
[![][github-release-shield]][github-release-link]
[![][github-stars-shield]][github-stars-link]
**English** · [简体中文](./README.zh-CN.md)
[//]: # (Language navigation)
**English** · [中文(简体)](./readmes/README.zh-hans.md) · [中文(繁體)](./readmes/README.zh-hant.md) · [日本語](./readmes/README.ja.md) · [Português (Brasil)](./readmes/README.pt-br.md)
</div>
<br/>