Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translations. #119

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/crowdin-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Download from crowdin

on:
workflow_dispatch:
schedule:
- cron: 0 * * * *

jobs:
download:
runs-on: ubuntu-latest
# secrets cannot be accessed inside an `if` so this needs to be checked in separate job
name: dowload
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master

- name: Install crowdin cli
run: |
wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list.d/crowdin.list
sudo apt-get update && sudo apt-get install crowdin3

- name: Download translations
shell: bash
run: |
crowdin download --all
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}

# - uses: EndBug/add-and-commit@v9
# with:
# message: "PO files updated."

# - name: Create pull request
# id: cpr_crowdin
# uses: peter-evans/create-pull-request@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: Crowdin translations download
# title: "[Crowdin] Updated translation files"
# body: |
# Created by the [Crowdin download workflow](.github/workflows/crowdin_download.yml).
# branch: "auto/crowdin"
# author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

- name: create pull request
run: gh pr create -B auto/crowdin -H master --title 'Update translations.' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/crowdin-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upload to crowdin

on:
workflow_dispatch:
push:
branches: [master]
paths:
- "**.py"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: master

- name: Install crowdin cli
run: |
wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list.d/crowdin.list
sudo apt-get update && sudo apt-get install crowdin3

- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip

- name: babel extract (pot file generation)
run: |
pip install babel
sh ./bin/pot-generation.sh

- name: Upload sources
shell: bash
run: |
crowdin upload
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
27 changes: 0 additions & 27 deletions .github/workflows/generate-mo-files.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/generate-pot-file.yml

This file was deleted.

3 changes: 3 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
project_id: "532668"
api_token_env: CROWDIN_API_KEY

files:
- source: /resources/locale/*.pot
translation: /resources/locale/%locale%/LC_MESSAGES/%file_name%.po
Binary file removed resources/locale/fr/LC_MESSAGES/mybot.mo
Binary file not shown.
Loading