Skip to content

Commit 45d9122

Browse files
committed
Enhance weblate pull script
1 parent b2424bb commit 45d9122

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

scripts/wlpull

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ do
135135
exit 1
136136
fi
137137

138+
# percents
139+
# skip english
140+
PERCS=`grep '^translated_percent: ' "$TMP" | cut -c 21- | tail -n +2`
141+
PERCS=`echo "$PERCS" | tr '\n' ' '`
142+
if [ -z "$PERCS" ]
143+
then
144+
echo "ERROR: No percentages found for $W"
145+
exit 1
146+
fi
147+
138148
rm -f "$TMP"
139149
# debug
140150
#echo
@@ -146,6 +156,10 @@ do
146156
echo
147157
#echo "Timestamps:"
148158
#echo "$TIMES"
159+
#echo
160+
#echo "Percentages:"
161+
#echo "$PERCS"
162+
#echo
149163

150164
i=0
151165
for LANG in $LANGS
@@ -160,10 +174,11 @@ do
160174
fi
161175
fi
162176

177+
PERC=`echo "$PERCS" | cut -d ' ' -f $i`
163178
FILE=`echo "$FILES" | cut -d ' ' -f $i`
164179
if [ ! -f "$FILE" -a -z "$L" ]
165180
then
166-
echo "SKIPPING $LANG - no local file $FILE"
181+
echo "SKIPPING $LANG ${PERC}% complete - no local file $FILE"
167182
echo "Force download with $0 $CX $LANG"
168183
continue
169184
fi
@@ -220,7 +235,7 @@ do
220235
RC=1
221236
continue
222237
fi
223-
echo "DOWNLOADED language $LANG to $FILE"
238+
echo "DOWNLOADED language $LANG ${PERC}% complete to $FILE"
224239
done
225240
done
226241

0 commit comments

Comments
 (0)