Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/translate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Translate Documentation

on:
push:
paths:
- README.md

workflow_dispatch:

jobs:
translate:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Co-op Translator
run: |
python -m pip install --upgrade pip
pip install co-op-translator

- name: Run Co-op Translator
env:
PYTHONIOENCODING: utf-8
AZURE_AI_SERVICE_API_KEY: ${{ secrets.AZURE_AI_SERVICE_API_KEY }}
AZURE_AI_SERVICE_ENDPOINT: ${{ secrets.AZURE_AI_SERVICE_ENDPOINT }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_MODEL_NAME: ${{ secrets.AZURE_OPENAI_MODEL_NAME }}
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
translate -l "zh-Hans"

- name: Commit and push translations
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add .
git commit -m "chore: update translations" || echo "No changes to commit"
git push
4 changes: 4 additions & 0 deletions translations/zh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Chinese Documentation

Chinese (Simplified) translations for OpenUI documentation will be generated
automatically using Co-op Translator.
6 changes: 6 additions & 0 deletions translator.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sourceLanguage": "en",
"targetLanguages": ["zh-Hans"],
"sourceDirectory": ".",
"targetDirectory": "translations"
}