2021-04-22 13:25:00 +00:00
|
|
|
name: Update Translation Files
|
2021-04-17 23:42:52 +00:00
|
|
|
|
2021-04-22 13:23:32 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-04-17 23:42:52 +00:00
|
|
|
|
2024-02-22 23:49:22 +00:00
|
|
|
env:
|
|
|
|
python_version: 3.9
|
2024-07-21 21:44:42 +00:00
|
|
|
node_version: 20
|
2024-02-22 23:49:22 +00:00
|
|
|
|
2024-03-24 22:11:16 +00:00
|
|
|
permissions:
|
2024-04-02 06:35:01 +00:00
|
|
|
contents: read
|
2024-03-24 22:11:16 +00:00
|
|
|
|
2021-04-17 23:42:52 +00:00
|
|
|
jobs:
|
2024-08-22 23:49:57 +00:00
|
|
|
synchronize-with-crowdin:
|
2021-04-17 23:42:52 +00:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-02 06:35:01 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-08-22 23:49:57 +00:00
|
|
|
pull-requests: write
|
2021-04-17 23:42:52 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2024-04-21 12:20:13 +00:00
|
|
|
INVENTREE_DB_NAME: "./test_db.sqlite"
|
2021-04-17 23:42:52 +00:00
|
|
|
INVENTREE_DB_ENGINE: django.db.backends.sqlite3
|
|
|
|
INVENTREE_DEBUG: info
|
|
|
|
INVENTREE_MEDIA_ROOT: ./media
|
|
|
|
INVENTREE_STATIC_ROOT: ./static
|
2022-10-16 13:09:31 +00:00
|
|
|
INVENTREE_BACKUP_DIR: ./backup
|
2024-03-18 01:53:48 +00:00
|
|
|
INVENTREE_SITE_URL: http://localhost:8000
|
2021-04-17 23:42:52 +00:00
|
|
|
|
|
|
|
steps:
|
2022-05-01 13:21:49 +00:00
|
|
|
- name: Checkout Code
|
2024-06-18 13:42:05 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4.1.7
|
2024-02-22 23:49:22 +00:00
|
|
|
- name: Environment Setup
|
|
|
|
uses: ./.github/actions/setup
|
2023-07-20 23:00:37 +00:00
|
|
|
with:
|
2024-02-22 23:49:22 +00:00
|
|
|
install: true
|
|
|
|
npm: true
|
|
|
|
apt-dependency: gettext
|
2022-05-01 13:21:49 +00:00
|
|
|
- name: Make Translations
|
2023-07-20 23:00:37 +00:00
|
|
|
run: invoke translate
|
2024-08-23 23:14:38 +00:00
|
|
|
- name: Remove compiled static files
|
|
|
|
run: rm -rf src/backend/InvenTree/static
|
|
|
|
- name: Remove all local changes that are not *.po files
|
|
|
|
run: |
|
2024-08-25 01:54:53 +00:00
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2024-08-24 00:28:09 +00:00
|
|
|
git add src/backend/InvenTree/locale/en/LC_MESSAGES/django.po src/frontend/src/locales/en/messages.po
|
2024-08-23 23:14:38 +00:00
|
|
|
git commit -m "add translations"
|
|
|
|
git reset --hard
|
|
|
|
git reset HEAD~
|
2024-08-22 23:49:57 +00:00
|
|
|
- name: crowdin action
|
|
|
|
uses: crowdin/github-action@6ed209d411599a981ccb978df3be9dc9b8a81699 # pin@v2
|
2022-05-01 13:21:49 +00:00
|
|
|
with:
|
2024-08-22 23:49:57 +00:00
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
download_translations: true
|
|
|
|
localization_branch_name: l10_crowdin
|
|
|
|
create_pull_request: true
|
|
|
|
pull_request_title: 'New Crowdin updates'
|
|
|
|
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
|
2024-08-27 23:34:37 +00:00
|
|
|
pull_request_base_branch_name: 'master'
|
2024-08-22 23:49:57 +00:00
|
|
|
pull_request_labels: 'translations'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|