🌐 Update translations via Co-op Translator (#679) #21
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_AI_SERVICE_API_KEY: ${{ secrets.AZURE_AI_SERVICE_API_KEY }} | |
| AZURE_AI_SERVICE_ENDPOINT: ${{ secrets.AZURE_AI_SERVICE_ENDPOINT }} | |
| # 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: | | |
| # translate -l "es fr de" -y | |
| # translate -l "fi nl he" -y | |
| # translate -l "vi sw ms" -y | |
| # translate -l "hu cs sk" -y | |
| # translate -l "id ro" -y | |
| # translate -l "pt zh ja" -y | |
| # translate -l "bg sr hr sl" -y | |
| # translate -l "uk my fa hi" -y | |
| translate -l "ko lt pl hk" -y | |
| # not yet translated languages are below. Uncomment line by line to translate. | |
| # translate -l "tw ar ur tl" -y | |
| # translate -l "mr ne pa bn" -y | |
| # translate -l "ru mo br it" -y | |
| # translate -l "tr el th" -y | |
| # translate -l "sv da no" -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 to the main branch. | |
| ### 📋 Changes included | |
| - Translated contents are available in the `translations/` directory | |
| - Translated images are available in the `translated_images/` directory | |
| --- | |
| 🌐 Automatically generated by the [Co-op Translator](https://github.com/Azure/co-op-translator) GitHub Action. | |
| branch: update-translations | |
| base: main | |
| labels: translation, automated-pr | |
| delete-branch: true | |
| add-paths: | | |
| translations/ | |
| translated_images/ |