Action examples

Translate on push

yaml
name: Translate

on:
  push:
    branches: [main]
    paths: ['**/*.xcstrings']

jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: autoglot/action@v2
        with:
          api-key: ${{ secrets.AUTOGLOT_API_KEY }}
          languages: 'de,fr,ja'

The action will automatically create a PR with the translated strings.

Specific files only

yaml
- uses: autoglot/action@v2
  with:
    api-key: ${{ secrets.AUTOGLOT_API_KEY }}
    languages: 'de,fr'
    files: 'MyApp/Resources/*.xcstrings'

Manual trigger

yaml
name: Manual Translate

on:
  workflow_dispatch:
    inputs:
      languages:
        description: 'Languages to translate'
        required: true
        default: 'de,fr,ja'

jobs:
  translate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: autoglot/action@v2
        with:
          api-key: ${{ secrets.AUTOGLOT_API_KEY }}
          languages: ${{ github.event.inputs.languages }}