1 name: i18n Validation
2
3 on:
4 pull_request:
5 paths:
6 - packages/admin/dashboard/src/i18n/translations/**
7
8 jobs:
9 i18n-validation-admin-dashboard:
10 runs-on: ubuntu-latest
11
12 steps:
13 - name: Checkout repository
14 uses: actions/checkout@v3
15 with:
16 fetch-depth: 0
17
18 - name: Set up Node.js
19 uses: actions/setup-node@v4
20 with:
21 node-version: "22"
22 cache: "yarn"
23
24 - name: Install dependencies
25 working-directory: packages/admin/dashboard
26 run: yarn install
27
28 - name: Validate i18n translations
29 working-directory: packages/admin/dashboard
30 run: |
31 git diff --name-only --diff-filter=A origin/develop HEAD -- src/i18n/translations > i18n_added_files.txt
32
33 cat i18n_added_files.txt
34
35 while read -r file; do
36 # Get the base name of the file
37 filename=$(basename "$file")
38
39 # Skip those items
40 if [ "$filename" = "\$schema.json" ] || [ "$filename" = "index.ts" ] || [ -d "$file" ]; then
41 continue
42 fi
43
44 # Run validation on the file
45 yarn i18n:validate "$filename"
46 done < i18n_added_files.txt