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