Skip to content

More updates and refactoring #13

More updates and refactoring

More updates and refactoring #13

Workflow file for this run

name: localization
on:
push:
branches: [ main ]
paths:
- '**.en.resx'
- '**.razor.en.resx'
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
required: true
default: 'Manual run'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@main
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Resource translator
id: resource-translator
uses: IEvangelist/resource-translator@main
with:
subscriptionKey: ${{ secrets.AZURE_TRANSLATOR_SUBSCRIPTION_KEY }}
endpoint: ${{ secrets.AZURE_TRANSLATOR_ENDPOINT }}
region: ${{ secrets.AZURE_TRANSLATOR_REGION }}
sourceLocale: 'en'
toLocales: '["af","ar","az","bg","ca","cs","da","de","el","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","la","lt","mk","nb","nl","pl","pt","ro","ru","sv","sk","sl","es","sr-Cyrl","sr-Latn","th","tr","uk","vi","zh-Hans","zh-Hant"]'
- name: Create pull request
uses: peter-evans/create-pull-request@v5
if: ${{ steps.resource-translator.outputs.has-new-translations }} == 'true'
with:
title: '${{ steps.resource-translator.outputs.summary-title }}'
body: '${{ steps.resource-translator.outputs.summary-details }}'