Skip to content

Apply i18n updates #475

Apply i18n updates

Apply i18n updates #475

# This workflow runs whenever locale/en.json is updated on the master branch
# It updates crowdin with new translation strings
# and notifies the #i18n @i18n in Discord of the new translations.
name: i18n upload bot
on:
workflow_dispatch:
push:
paths:
- "src/locale/en.json"
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DIM
uses: actions/checkout@v4
- name: Sort en.json
run: dimJSON="$(jq -S . src/locale/en.json)" && echo "${dimJSON}" > src/locale/en.json
- name: Upload updated en.json to crowdin
uses: crowdin/github-action@v2.1.1
with:
upload_sources: true
upload_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: porcelain check
uses: dorny/paths-filter@v3
id: filter
with:
base: HEAD
filters: |
changed:
- 'src/locale/en.json'
- name: Discord notification
# TODO: Add back in the number of changes via `git diff --numstat -- src/locale/en.json` and some awk or grep magic
if: steps.filter.outputs.changed
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_I18N_WEBHOOK }}
DISCORD_EMBEDS: '[{"title":"DIM - crowdin", "color": 15954978, "url": "https://crowdin.com/project/destiny-item-manager","description": "Translation(s) have been added or changed on crowdin." }]'
uses: Ilshidur/action-discord@master
with:
args: "<@&622449489008918548>"