Skip to content

Commit

Permalink
Feature/translations workflow (PythonFreeCourse#150)
Browse files Browse the repository at this point in the history
* feat: add translations workflow

* fix(translations-workflow): fix doc

* fix(translations-workflow): fixed code and added automatic commit

Co-authored-by: Gonny <1@1>
  • Loading branch information
Gonzom and sMOKIK committed Feb 5, 2021
1 parent a1f2998 commit 2e6a2c2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/translatable-string-extract.yml
@@ -0,0 +1,32 @@
# This workflow will extract new translatable strings from files under /app and /tests into a base.pot file,
# and update the 'en' and 'he' base.po and base.mo files.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: update-translations

on: [push]

jobs:
update-translations:

runs-on: ubuntu-latest

steps:

- name: Create base.pot file
run: pybabel extract --mapping-file=app/babel_mapping.ini app tests -o app/locales/base.pot -c i18n

- name: Move to /app directory
run: cd app

- name: Update all language base.po files
run: pybabel update -i locales/base.pot -d locales -D base

- name: Update all .mo files
run: pybabel compile -d locales -D base

# https://github.com/stefanzweifel/git-auto-commit-action
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply automatic translateable string changes

0 comments on commit 2e6a2c2

Please sign in to comment.