👷(project) rename i18n-back to i18n-crowdin

Rename i18n-back to i18n-crowdin.
Change the job to use the 'age' env.
This commit is contained in:
Anthony LC
2024-04-03 12:44:57 +02:00
committed by Anthony LC
parent 8afc003004
commit d19c7f7fd8
2 changed files with 30 additions and 6 deletions

View File

@@ -159,31 +159,55 @@ jobs:
- name: Run tests - name: Run tests
run: ~/.local/bin/pytest -n 2 run: ~/.local/bin/pytest -n 2
i18n-back: i18n-crowdin:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install gettext (required to make messages) - name: Install gettext (required to make messages)
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y gettext sudo apt-get install -y gettext
- name: Install Python - name: Install Python
uses: actions/setup-python@v3 uses: actions/setup-python@v3
with: with:
python-version: '3.10' python-version: '3.10'
- name: Install development dependencies - name: Install development dependencies
working-directory: src/backend working-directory: src/backend
run: pip install --user .[dev] run: pip install --user .[dev]
- name: Generate the translation base file - name: Generate the translation base file
run: ~/.local/bin/django-admin makemessages --keep-pot --all run: ~/.local/bin/django-admin makemessages --keep-pot --all
- name: Load sops secrets
uses: rouja/actions-sops@main
with:
secret-file: .github/workflows/secrets.enc.env
age-key: ${{ secrets.SOPS_PRIVATE }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
cache-dependency-path: src/frontend/yarn.lock
- name: Install dependencies
run: cd src/frontend/ && yarn install --frozen-lockfile
- name: Extract the frontend translation
run: make frontend-i18n-extract
- name: Upload files to Crowdin - name: Upload files to Crowdin
run: | run: |
docker run \ docker run \
--rm \ --rm \
-e CROWDIN_API_TOKEN=${{ secrets.CROWDIN_API_TOKEN }} \ -e CROWDIN_API_TOKEN=$CROWDIN_API_TOKEN \
-e CROWDIN_PROJECT_ID=${{ vars.CROWDIN_PROJECT_ID }} \ -e CROWDIN_PROJECT_ID=$CROWDIN_PROJECT_ID \
-e CROWDIN_BASE_PATH=${{ vars.CROWDIN_BASE_PATH }} \ -e CROWDIN_BASE_PATH=$CROWDIN_BASE_PATH \
-v "${{ github.workspace }}:/app" \ -v "${{ github.workspace }}:/app" \
crowdin/cli:3.16.0 \ crowdin/cli:3.16.0 \
crowdin upload sources -c /app/crowdin/config.yml crowdin upload sources -c /app/crowdin/config.yml

View File

@@ -17,12 +17,12 @@ preserve_hierarchy: true
files: [ files: [
{ {
source : "/backend/locale/django.pot", source : "/backend/locale/django.pot",
dest: "/backend.pot", dest: "/backend-impress.pot",
translation : "/backend/locale/%locale_with_underscore%/LC_MESSAGES/django.po" translation : "/backend/locale/%locale_with_underscore%/LC_MESSAGES/django.po"
}, },
{ {
source: "/frontend/packages/i18n/locales/impress/translations-crowdin.json", source: "/frontend/packages/i18n/locales/impress/translations-crowdin.json",
dest: "/impress.json", dest: "/frontend-impress.json",
translation: "/frontend/packages/i18n/locales/impress/%two_letters_code%/translations.json", translation: "/frontend/packages/i18n/locales/impress/%two_letters_code%/translations.json",
skip_untranslated_strings: true, skip_untranslated_strings: true,
}, },