File tree Expand file tree Collapse file tree 2 files changed +69
-21
lines changed
Expand file tree Collapse file tree 2 files changed +69
-21
lines changed Original file line number Diff line number Diff line change 1+ name : I18n Validate
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' resources/translations/**/*.xlf'
7+ - ' composer.lock'
8+ - ' composer.json'
9+
10+ jobs :
11+ validate-xliff :
12+ runs-on : ubuntu-22.04
13+
14+ strategy :
15+ fail-fast : false
16+ matrix :
17+ php : ['8.1']
18+
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Setup PHP
24+ uses : shivammathur/setup-php@v2
25+ with :
26+ php-version : ${{ matrix.php }}
27+ extensions : imap, zip
28+ tools : composer:v2
29+ coverage : none
30+
31+ - name : Cache Composer packages
32+ uses : actions/cache@v4
33+ with :
34+ path : |
35+ ~/.composer/cache/files
36+ key : ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
37+ restore-keys : |
38+ ${{ runner.os }}-composer-${{ matrix.php }}-
39+
40+ - name : Install dependencies (no dev autoloader scripts)
41+ run : |
42+ set -euo pipefail
43+ composer install --no-interaction --no-progress --prefer-dist
44+
45+ - name : Lint XLIFF with Symfony
46+ run : |
47+ set -euo pipefail
48+ # Adjust the directory to match your repo layout
49+ php bin/console lint:xliff resources/translations
50+
51+ - name : Validate XLIFF XML with xmllint
52+ run : |
53+ set -euo pipefail
54+ sudo apt-get update
55+ sudo apt-get install -y --no-install-recommends libxml2-utils
56+ # Adjust root dir; prune vendor; accept spaces/newlines safely
57+ find resources/translations -type f -name '*.xlf' -not -path '*/vendor/*' -print0 \
58+ | xargs -0 -n1 xmllint --noout
59+
60+ - name : Symfony translation sanity (extract dry-run)
61+ run : |
62+ set -euo pipefail
63+ # Show what would be created/updated without writing files
64+ php bin/console translation:extract en \
65+ --format=xlf \
66+ --domain=messages \
67+ --dump-messages \
68+ --no-interaction
69+ # Note: omit --force to keep this a dry-run
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments