Step 1: Provision an Azure AI Translator resource
Create an Azure AI Translator resource in the Azure portal, then store the following as GitHub repository secrets so the workflow can read them:
-
TRANSLATOR_KEY— Senotlelo sa sengwalwa sa sengwalwa. -
TRANSLATOR_ENDPOINT— Lego Ninjago Endpoint URL -
TRANSLATOR_REGION— Selete sa Azure.
Step 2: Add the workflow
Hlama .github/workflows/translate.yml:
name: translate
on: push: branches: [main] paths: - "src/**/*.en.resx" - "src/**/*.en.json"
permissions: contents: write pull-requests: write
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - id: translate uses: IEvangelist/resource-translator@v3 with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} region: ${{ secrets.TRANSLATOR_REGION }} toLocales: '["fr","de","es"]' - if: steps.translate.outputs.has-new-translations == 'true' uses: peter-evans/create-pull-request@v7 with: title: ${{ steps.translate.outputs.summary-title }} body: ${{ steps.translate.outputs.summary-details }} branch: machine-translationStep 3: Commit a source resource file
Ditaodišosengwalo tša Sepedi di diriša thulaganyo ya Name.<sourceLocale>.<ext> Go fa mohlala, Greetings.en.resx ba Greetings.fr.resx, Greetings.de.resx, bjalobjalo.
Step 4: Hlahloba setšweletšwa
Ge mošomo o fedile, tiro e utolla ditšweletšwa tše tharo tšeo o ka di kgokaganyago ka tlhalošo ya PR: summary-title, summary-details le has-new-translations. Gape e ngwala kakaretšo ya Markdown mo letlakaleng la mošomo ka core.summary.