-
-
Notifications
You must be signed in to change notification settings - Fork 207
59 lines (53 loc) · 2.02 KB
/
Copy pathimport-polish-translation.yml
File metadata and controls
59 lines (53 loc) · 2.02 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
name: Import Polish translation
on:
pull_request:
branches:
- master
types:
- opened
- synchronize
workflow_dispatch:
permissions:
contents: write
jobs:
import:
if: github.head_ref == 'agent/update-polish-translation'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: agent/update-polish-translation
fetch-depth: 0
- name: Reconstruct and validate translation
shell: bash
run: |
set -euo pipefail
cat .translation-import/plchunk*.b64 | base64 --decode | gzip --decompress > src/translations/qdomyos-zwift_pl.ts
echo "7fa51748ae0a152a64c5928e0a07e70378d85a206ae12a37f52e3d0b336c03e2 src/translations/qdomyos-zwift_pl.ts" | sha256sum --check
python3 - <<'PY'
import xml.etree.ElementTree as ET
path = 'src/translations/qdomyos-zwift_pl.ts'
root = ET.parse(path).getroot()
assert root.attrib.get('language') == 'pl_PL', root.attrib.get('language')
messages = root.findall('.//message')
translations = root.findall('.//translation')
assert len(messages) == 1539, len(messages)
assert len(translations) == 1539, len(translations)
assert all((t.text or '').strip() for t in translations)
assert not any(t.get('type') == 'unfinished' for t in translations)
print('Polish translation validated:', len(messages), 'messages')
PY
- name: Remove temporary import files
shell: bash
run: |
rm -rf .translation-import
rm -f .github/workflows/import-polish-translation.yml
- name: Commit final translation
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "i18n: update Polish translation"
git push origin HEAD:agent/update-polish-translation