|
| 1 | +name: Download translations from Crowdin |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + download: |
| 8 | + name: Download translations and update files |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Checkout repository |
| 12 | + uses: actions/checkout@v6 |
| 13 | + |
| 14 | + - name: Install uv |
| 15 | + uses: astral-sh/setup-uv@v7 |
| 16 | + with: |
| 17 | + python-version: '3.10' |
| 18 | + activate-environment: "true" |
| 19 | + enable-cache: "true" |
| 20 | + |
| 21 | + - name: Install Python dependencies |
| 22 | + run: uv pip sync requirements.txt |
| 23 | + |
| 24 | + - name: Use pnpm |
| 25 | + uses: pnpm/action-setup@v6.0.3 |
| 26 | + |
| 27 | + - name: Use Node.js |
| 28 | + uses: actions/setup-node@v6 |
| 29 | + with: |
| 30 | + node-version: '20.x' |
| 31 | + cache: 'pnpm' |
| 32 | + |
| 33 | + - name: Setup Java for crowdin-cli |
| 34 | + uses: actions/setup-java@v5 |
| 35 | + with: |
| 36 | + distribution: 'temurin' |
| 37 | + java-version: '17' |
| 38 | + |
| 39 | + - name: Install gettext |
| 40 | + run: sudo apt-get update && sudo apt-get install -y gettext |
| 41 | + |
| 42 | + - name: Install JavaScript dependencies |
| 43 | + run: pnpm install --frozen-lockfile |
| 44 | + |
| 45 | + - name: Download translations |
| 46 | + env: |
| 47 | + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_KEY }} |
| 48 | + run: make i18n-download |
| 49 | + |
| 50 | + - name: Generate App Token |
| 51 | + id: generate-token |
| 52 | + uses: actions/create-github-app-token@v3 |
| 53 | + with: |
| 54 | + app-id: ${{ secrets.LE_BOT_APP_ID }} |
| 55 | + private-key: ${{ secrets.LE_BOT_PRIVATE_KEY }} |
| 56 | + |
| 57 | + - name: Create Pull Request |
| 58 | + uses: peter-evans/create-pull-request@v8 |
| 59 | + with: |
| 60 | + token: ${{ steps.generate-token.outputs.token }} |
| 61 | + commit-message: | |
| 62 | + Update translations from Crowdin |
| 63 | +
|
| 64 | + This includes: |
| 65 | + - Updated translation files (.po and .json) |
| 66 | + - Compiled Django messages (.mo files) |
| 67 | + - Updated frontend i18n files |
| 68 | + branch: i18n-update-${{ github.ref_name }} |
| 69 | + base: ${{ github.ref_name }} |
| 70 | + delete-branch: true |
| 71 | + title: 'Update translations from Crowdin for ${{ github.ref_name }}' |
| 72 | + body: | |
| 73 | + ## Summary of changes |
| 74 | +
|
| 75 | + This PR updates translations downloaded from Crowdin. |
| 76 | +
|
| 77 | + ### Changes included: |
| 78 | + - Updated translation files (`.po` and `.json`) |
| 79 | + - Compiled Django messages (`.mo` files) |
| 80 | + - Updated frontend i18n files |
| 81 | +
|
| 82 | + ### Testing checklist: |
| 83 | + - [ ] Verify that translations are not obviously empty or untranslated in the message files |
| 84 | + - [ ] Switch to a few different languages and navigate the app |
| 85 | + labels: | |
| 86 | + i18n |
| 87 | + TAG: user strings |
0 commit comments