Skip to content

Commit

Permalink
Automatically update translations (#73)
Browse files Browse the repository at this point in the history
* Update update-translations.yml

* Update update-pot.yml

update git auto commit action version
  • Loading branch information
SteelWagstaff authored Mar 4, 2022
1 parent 2bcff6e commit 8cca74f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Update POT file
run: wp pb make-pot . languages/pressbooks-cas-sso.pot --require=vendor/autoload.php --domain=pressbooks-cas-sso --slug=pressbooks-cas-sso --package-name="Pressbooks CAS SSO" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-cas-sso/issues\"}"
- name: Commit updated POT file
uses: stefanzweifel/git-auto-commit-action@v4.1.1
uses: stefanzweifel/git-auto-commit-action@v4.13.1
with:
commit_message: 'chore(l10n): update languages/pressbooks-cas-sso.pot'
file_pattern: '*.pot'
17 changes: 7 additions & 10 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT_FOR_GITHUB_ACTIONS }}
- name: Install Transifex Client
run: sudo pip install transifex-client
- name: Pull translations from Transifex
run: tx pull -all --force --minimum-perc=25
run: tx pull --all --force --minimum-perc=25
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Install xgettext
run: sudo apt-get install -y gettext
- name: Generate MO files
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.
- uses: actions/upload-artifact@v2
- name: Commit updated translation files
uses: stefanzweifel/git-auto-commit-action@v4.13.1
with:
name: pressbooks-cas-sso-languages
path: languages/
# - 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
commit_message: 'chore(l10n): update translations'
file_pattern: '*.mo *.po'

0 comments on commit 8cca74f

Please sign in to comment.