Skip to content

Commit 2e6a2c2

Browse files
GonzomsMOKIK
andauthored
Feature/translations workflow (#150)
* feat: add translations workflow * fix(translations-workflow): fix doc * fix(translations-workflow): fixed code and added automatic commit Co-authored-by: Gonny <1@1>
1 parent a1f2998 commit 2e6a2c2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow will extract new translatable strings from files under /app and /tests into a base.pot file,
2+
# and update the 'en' and 'he' base.po and base.mo files.
3+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
4+
5+
name: update-translations
6+
7+
on: [push]
8+
9+
jobs:
10+
update-translations:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Create base.pot file
17+
run: pybabel extract --mapping-file=app/babel_mapping.ini app tests -o app/locales/base.pot -c i18n
18+
19+
- name: Move to /app directory
20+
run: cd app
21+
22+
- name: Update all language base.po files
23+
run: pybabel update -i locales/base.pot -d locales -D base
24+
25+
- name: Update all .mo files
26+
run: pybabel compile -d locales -D base
27+
28+
# https://github.com/stefanzweifel/git-auto-commit-action
29+
- name: Commit changes
30+
uses: stefanzweifel/git-auto-commit-action@v4
31+
with:
32+
commit_message: Apply automatic translateable string changes

0 commit comments

Comments
 (0)