68 lines
2.2 KiB
YAML
68 lines
2.2 KiB
YAML
|
name: updatemessages
|
||
|
on:
|
||
|
schedule:
|
||
|
- cron: '0 * * * *'
|
||
|
jobs:
|
||
|
updatemessages:
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- uses: actions/checkout@v1
|
||
|
- name: Set up Python 3.7
|
||
|
uses: actions/setup-python@v1
|
||
|
with:
|
||
|
python-version: 3.7
|
||
|
- name: Checkout submodules
|
||
|
run: |
|
||
|
git submodule init
|
||
|
git submodule update
|
||
|
- name: Install requirements
|
||
|
run: |
|
||
|
sudo apt-get install gettext
|
||
|
curl -O https://artifacts.crowdin.com/repo/deb/crowdin.deb
|
||
|
sudo dpkg -i crowdin.deb
|
||
|
pip install -r requirements.txt
|
||
|
pip install pymysql
|
||
|
- name: Download strings from Crowdin
|
||
|
env:
|
||
|
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
|
||
|
run: |
|
||
|
cat > crowdin.yaml <<EOF
|
||
|
project_identifier: dmoj
|
||
|
|
||
|
files:
|
||
|
- source: /locale/en/LC_MESSAGES/django.po
|
||
|
translation: /locale/%two_letters_code%/LC_MESSAGES/django.po
|
||
|
languages_mapping:
|
||
|
two_letters_code:
|
||
|
zh-CN: zh_Hans
|
||
|
zh-TW: zh_Hant
|
||
|
sr-CS: sr_Latn
|
||
|
- source: /locale/en/LC_MESSAGES/djangojs.po
|
||
|
translation: /locale/%two_letters_code%/LC_MESSAGES/djangojs.po
|
||
|
languages_mapping:
|
||
|
two_letters_code:
|
||
|
zh-CN: zh_Hans
|
||
|
zh-TW: zh_Hant
|
||
|
sr-CS: sr_Latn
|
||
|
EOF
|
||
|
echo "api_key: ${CROWDIN_API_TOKEN}" >> crowdin.yaml
|
||
|
crowdin download
|
||
|
rm crowdin.yaml
|
||
|
- name: Cleanup
|
||
|
run: |
|
||
|
rm -rf src/
|
||
|
git add locale
|
||
|
git checkout .
|
||
|
git clean -fd
|
||
|
- name: Create pull request
|
||
|
uses: peter-evans/create-pull-request@v1.4.1-multi
|
||
|
env:
|
||
|
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
|
||
|
COMMIT_MESSAGE: 'i18n: update translations from Crowdin'
|
||
|
PULL_REQUEST_TITLE: 'Update translations from Crowdin'
|
||
|
PULL_REQUEST_BODY: This PR has been auto-generated to pull in latest translations from [Crowdin](https://translate.dmoj.ca).
|
||
|
PULL_REQUEST_LABELS: i18n, enhancement
|
||
|
PULL_REQUEST_REVIEWERS: Xyene, quantum5
|
||
|
PULL_REQUEST_BRANCH: update-i18n
|
||
|
BRANCH_SUFFIX: none
|