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— the subscription key for the resource. -
TRANSLATOR_ENDPOINT— the regional endpoint URL. -
TRANSLATOR_REGION— the resource's Azure region.
Step 2: Add the workflow
Create .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
Resource files use the Name.<sourceLocale>.<ext> convention. For example Greetings.en.resx becomes Greetings.fr.resx, Greetings.de.resx, and so on after a run.
Step 4: Inspect the output
Once the workflow finishes, the action exposes three outputs you can wire into a PR description: summary-title, summary-details, and has-new-translations. It also writes a Markdown summary into the job page via core.summary.