forked from 4teamwork/opengever.core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-i18n-de.cfg
97 lines (79 loc) · 2.14 KB
/
test-i18n-de.cfg
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
[buildout]
extends =
https://raw.githubusercontent.com/4teamwork/ftw-buildouts/master/test-base.cfg
versions.cfg
parts =
package-directory
i18ndude
bin-test-jenkins
package-name = opengever.core
package-namespace = opengever
jenkins_python = $PYTHON27
[bin-test-jenkins]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
shopt -s globstar
OUTPUT=""
# Catch fuzzy translations from committed locales
OUTPUT+=$(grep -nA5 fuzzy opengever/*/locales/*/LC_MESSAGES/*.po)
# Potential newline for visual clarity
if [ -n "$OUTPUT" ]
then
OUTPUT+="Pre-build:"
OUTPUT+="\n\n"
fi
# Test building locales - split into 2 passes for different context lengths
OUTPUT+=$(bin/i18n-build --all 2>&1 | grep -A 3 -e '^Warning')
# Potential newline for visual clarity
if [ -n "$OUTPUT" ]
then
OUTPUT+="\n\n"
fi
OUTPUT+=$(bin/i18n-build --all 2>&1 | grep -A 1 -e '^Merge-Warning')
# Potential newline for visual clarity
if [ -n "$OUTPUT" ]
then
OUTPUT+="Post-build:"
OUTPUT+="\n\n"
fi
# Catch fuzzy translations from recopiled locales
OUTPUT+=$(grep -nA5 fuzzy opengever/*/locales/*/LC_MESSAGES/*.po)
if [ -n "$OUTPUT" ]
then
# Newlines for visual clarity
echo ""
echo ""
echo ""
echo "Failed to build locales properly:"
echo ""
echo -e "$OUTPUT"
echo ""
echo ""
echo ""
exit 1
fi
# Inspect every generated german locale file
for file in opengever/**/locales/de/LC_MESSAGES/*.po
do
# Use the perl regex engine grep to do multiline matching
# Newlines for visual clarity
OUTPUT+=$(echo "" && echo "" && pcregrep -n -H -B 1 -M 'msgstr ""\n\n' "$file")
done
if [ -n "$OUTPUT" ]
then
# Newlines for visual clarity
echo ""
echo ""
echo ""
echo "Missing translations:"
echo ""
echo -e "$OUTPUT"
echo ""
echo ""
echo ""
exit 1
fi
exit 0
output = ${buildout:bin-directory}/test-jenkins
mode = 755