# Transform localizations from TranslateWiki.net
#
# As of late 2020, TranslateWiki creates PRs automatically, in line with
# how they work with other repos. However, the strings still need to be
# translated to work well with the iOS app. This script runs when a new PR
# is created by TranslateWiki, to add everything the app needs to the PR.
#
name: Import localizations from TranslateWiki

on:
  push:
    branches:
        - twn

jobs:
  update-localizations:
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v2

    - name: Update localizations
      continue-on-error: true
      run: |
        $GITHUB_WORKSPACE/scripts/localization $GITHUB_WORKSPACE
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add .
        git commit -m "Import translations from TranslateWiki"
        git push
