Merge pull request #346 from hyoshioka0128/patch-21 #272
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Co-op Translator | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
co-op-translator: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: 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 Credentials | |
AZURE_SUBSCRIPTION_KEY: ${{ secrets.AZURE_SUBSCRIPTION_KEY }} | |
AZURE_AI_SERVICE_ENDPOINT: ${{ secrets.AZURE_AI_SERVICE_ENDPOINT }} | |
AZURE_AI_SERVICE_API_KEY: ${{ secrets.AZURE_AI_SERVICE_API_KEY }} | |
# Azure OpenAI Credentials | |
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 Credentials | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }} | |
OPENAI_CHAT_MODEL_ID: ${{ secrets.OPENAI_CHAT_MODEL_ID }} | |
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
run: | | |
# ===================================================================== | |
# IMPORTANT: Set your target languages here (REQUIRED CONFIGURATION) | |
# ===================================================================== | |
# Example: Translate to Spanish, French, German. Add -y to auto-confirm. | |
translate -l "all" -y # <--- MODIFY THIS LINE with your desired languages | |
# Recommendation for large batches over 29 files run them in batches maximum github runner time is 6 hours | |
# translate -l "zh tw hk fr ja ko pt es de fa pl hi" -y | |
# translate -l "ru ar ur mo ja bn mr ne pa br it tr" -y | |
# translate -l "el th sv da no fi nl he vi id ms tl" -y | |
# translate -l "sw hu cs sk ro bg sr hr sl uk my" -y | |
- name: Authenticate GitHub App | |
id: generate_token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.GH_APP_ID }} | |
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
- name: Create Pull Request with translations | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
commit-message: "🌐 Update translations via Co-op Translator" | |
title: "🌐 Update translations via Co-op Translator" | |
body: | | |
This PR updates translations for recent changes merged into the `main` branch. | |
### 📋 Summary of Changes | |
- Translated markdown content has been added under the `translations/` directory | |
- Translated images (if applicable) have been generated in the `translated_images/` directory | |
🔁 Co-op Translator ensures that changes in links, structure, or inline elements in the original content are automatically reflected in all translated files. | |
--- | |
🌐 This pull request was automatically generated by [Co-op Translator](https://github.com/Azure/co-op-translator), powered by Azure AI. | |
branch: update-translations | |
base: main | |
delete-branch: true | |
add-paths: | | |
translations/ | |
translated_images/ | |