Skip to content

i18n download bot

i18n download bot #297

# This workflow runs every Saturday @ 1900 UTC (NOON PST)
name: i18n download bot
on:
workflow_dispatch:
schedule:
- cron: "0 19 * * 6"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DIM
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.I18N_PAT }}
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Download updated i18n files
uses: crowdin/[email protected]
with:
upload_sources: false
upload_translations: false
download_translations: true
create_pull_request: false
push_translations: false
source: src/locale/en.json
translation: src/locale/%android_code%.json
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: sort locale json
run: |
allLocales=("en" "de" "es" "esMX" "fr" "it" "ja" "ko" "pl" "ptBR" "ru" "zhCHS" "zhCHT")
for lang in ${allLocales[@]}; do
jq -S . src/locale/$lang.json > src/locale/sorted_$lang.json && mv src/locale/sorted_$lang.json src/locale/$lang.json
done
- name: build browsercheck utils
run: pnpm bcu
- name: porcelain check
uses: dorny/paths-filter@v3
id: filter
with:
base: HEAD
filters: |
changed:
- '**'
- name: Commit files
if: steps.filter.outputs.changed
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: i18n
commit_user_name: DIM i18n Bot
commit_user_email: [email protected]
commit_author: DIM i18n Bot <[email protected]>