Browse Source

Automatically update translations (#322)

* Update update-translations.yml

* Update update-pot.yml

update git auto commit version
pull/323/head
Steel Wagstaff 3 years ago committed by GitHub
parent
commit
f896517aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/update-pot.yml
  2. 15
      .github/workflows/update-translations.yml

2
.github/workflows/update-pot.yml

@ -29,7 +29,7 @@ jobs:
- name: Update POT file - name: Update POT file
run: wp pb make-pot . languages/pressbooks-aldine.pot --require=vendor/autoload.php --domain=pressbooks-aldine --slug=pressbooks-aldine --package-name="Aldine" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-aldine/issues\"}" run: wp pb make-pot . languages/pressbooks-aldine.pot --require=vendor/autoload.php --domain=pressbooks-aldine --slug=pressbooks-aldine --package-name="Aldine" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-aldine/issues\"}"
- name: Commit updated POT file - name: Commit updated POT file
uses: stefanzweifel/git-auto-commit-action@v4.1.1 uses: stefanzweifel/git-auto-commit-action@v4.13.1
with: with:
commit_message: 'chore(l10n): update languages/pressbooks-aldine.pot' commit_message: 'chore(l10n): update languages/pressbooks-aldine.pot'
file_pattern: '*.pot' file_pattern: '*.pot'

15
.github/workflows/update-translations.yml

@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
- name: Install Transifex Client - name: Install Transifex Client
run: sudo pip install transifex-client run: sudo pip install transifex-client
- name: Pull translations from Transifex - name: Pull translations from Transifex
@ -17,13 +19,8 @@ jobs:
run: sudo apt-get install -y gettext run: sudo apt-get install -y gettext
- name: Generate MO files - name: Generate MO files
run: for file in languages/*.po ; do msgfmt $file -o `echo $file | sed 's/\(.*\.\)po/\1mo/'` ; done run: for file in languages/*.po ; do msgfmt $file -o `echo $file | sed 's/\(.*\.\)po/\1mo/'` ; done
# Remove the next four lines and uncomment the last six lines once the process has been confirmed to work as desired. - name: Commit updated translation files
- uses: actions/upload-artifact@v2 uses: stefanzweifel/git-auto-commit-action@v4.13.1
with: with:
name: pressbooks-aldine-languages commit_message: 'chore(l10n): update translations'
path: languages/ file_pattern: '*.mo *.po'
# - name: Commit updated translation files
# uses: stefanzweifel/git-auto-commit-action@v4.1.1
# with:
# commit_message: 'chore(l10n): update translations'
# file_pattern: *.mo *.po

Loading…
Cancel
Save