Skip to content

Commit

Permalink
Keep the pseudo locale up to date
Browse files Browse the repository at this point in the history
This change introduces a manual GitHub Actions job that downloads and commits the translation files from Crowdin. The editor won't know about new strings until this is run.

Refs #2116
  • Loading branch information
thewilkybarkid committed Dec 12, 2024
1 parent 2bf6680 commit 2f32e65
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/update-locales.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Update locales

on:
workflow_dispatch:

permissions:
contents: write

jobs:
update-locales:
name: 'Update locales'
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
- name: 'Checkout code'
uses: actions/[email protected]
with:
token: ${{ secrets.PREREVIEW_BOT_TOKEN }}
sparse-checkout: |
locales/
crowdin.yml
sparse-checkout-cone-mode: false

- name: 'Download translations from Crowdin'
uses: crowdin/[email protected]
with:
upload_sources: false
upload_translations: false
download_sources: false
download_translations: true
export_only_approved: true
push_translations: false
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}

- name: 'Remove empty files'
run: grep --files-with-matches --recursive --null "^{}" locales | xargs --no-run-if-empty -0 rm

- name: 'Remove empty locales'
run: find locales -empty -type d -delete

- name: 'Commit changes'
uses: stefanzweifel/[email protected]
if: ${{ !env.ACT }}
with:
commit_message: 'Update locales'
commit_user_name: 'prereview-bot'
commit_user_email: '[email protected]'
commit_author: 'prereview-bot <[email protected]>'

0 comments on commit 2f32e65

Please sign in to comment.