Skip to content

Commit

Permalink
Add GitHub Action for translation sync
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiessinger committed Oct 2, 2024
1 parent bd74d0d commit dc9089c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/automatic-sync-related-languages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Automatic synchronization of related languages

on:
push:
branches:
- main
- master
workflow_dispatch: # Allows manual trigger

jobs:
sync-translations:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Copy de_DE translation files to de_AT and de_CH
run: |
mkdir -p ./wp-content/plugins/my-plugin/languages
cp ./wp-content/plugins/my-plugin/languages/de_DE.po ./wp-content/plugins/my-plugin/languages/de_AT.po
cp ./wp-content/plugins/my-plugin/languages/de_DE.mo ./wp-content/plugins/my-plugin/languages/de_AT.mo
cp ./wp-content/plugins/my-plugin/languages/de_DE.po ./wp-content/plugins/my-plugin/languages/de_CH.po
cp ./wp-content/plugins/my-plugin/languages/de_DE.mo ./wp-content/plugins/my-plugin/languages/de_CH.mo
- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Sync translation files for de_AT and de_CH"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit dc9089c

Please sign in to comment.