Validator
Installation
pnpm add @jsverse/transloco-validator --save-devyarn add @jsverse/transloco-validator --devnpm install @jsverse/transloco-validator --save-devUsage
"src/assets/i18n/*.json": ["transloco-validator"]name: Validate Translation Files
on:
pull_request:
paths:
# Trigger when any i18n JSON file is modified
- 'src/assets/i18n/**.json'
jobs:
validate-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Dependencies
run: npm ci
- name: Run Transloco Validator on Changed i18n Files
run: |
# Find the changed i18n files and run the validator on them
git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'src/assets/i18n/.*\.json' | xargs npx transloco-validatorBenefits
Was this helpful?

