-
-
Notifications
You must be signed in to change notification settings - Fork 1k
61 lines (55 loc) · 1.59 KB
/
translations.yml
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
name: Check translations
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Trubar
run: |
pip install trubar
- name: Collect translations
run: |
cd i18n
trubar collect -s ../Orange new.jaml
trubar merge -u Obsolete.jaml si.jaml new.jaml
trubar missing -o Missing.jaml new.jaml
if [ ! -s Missing.jaml ]
then
rm Missing.jaml
fi
- name: Check translations
run: |
cd i18n
for fn in Obsolete Missing
do
if [ -f $fn.jaml ]
then
echo "::group::$fn translations"
cat $fn.jaml
echo "::endgroup::"
fi
done
echo "-------------------------------"
trubar stat new.jaml
echo "-------------------------------"
if [ -f Missing.jaml ] || [ -f Obsolete.jaml ]
then
echo "### Missing or obsolete translations" >> $GITHUB_STEP_SUMMARY
echo "::error::Missing or obsolete translations"
echo "Run 'trubar collect -s Orange i18n/si.jaml'"
echo "and see the changes in the message file, i18n/si.jaml"
exit 1
else
echo "### All translations are up to date" >> $GITHUB_STEP_SUMMARY
fi