blob: 0dc23a22cc708162282d795658fa604f021cacb9 (
plain)
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
|
#!/bin/sh
set -e
# Script to help translators to check the integrity of po files in live-manual.
#
# 'msgfmt' performs several checks and outputs some common errors:
#
# - Checks format
# - Checks header
# - ...
#
# We do not want to compile a .mo file so we use /dev/null.
#
echo ""
echo "This script can help you check the integrity of po files."
echo "Select: $(ls -C manual/po) ['a' to see all] ['q' to quit] "
# Creating function
Integrity_check()
{
echo "Checking the integrity of $(ls manual/po/${LANGUAGE}/* | wc -l) po files in ${LANGUAGE}."
echo ""
for POFILE in manual/po/${LANGUAGE}/*
do
echo "-$(basename ${POFILE})"
msgfmt --verbose --check --output-file=/dev/null ${POFILE} || { echo "-> This .po file might be 'BAD'. Please revise it."; echo ""; exit 1; }
if [ "$?" -eq "0" ]
then
echo "-> This .po file is 'GOOD'."
echo ""
fi
done
}
# Menu.
read LANGUAGE
case "$LANGUAGE" in
en) echo "Nothing to be done, really!"
;;
ca|de|es|fr|it|ja|pl|pt_BR|ro)
Integrity_check
;;
a) for LANGUAGE in manual/po/*
do
for POFILE in ${LANGUAGE}/*
do
echo "-Checking the integrity of '$(basename ${POFILE})' in '$(basename ${LANGUAGE})'"
msgfmt --verbose --check --output-file=/dev/null ${POFILE} || { echo "-> This .po file might be 'BAD'. Please revise it."; echo ""; exit 1; }
if [ "$?" -eq "0" ]
then
echo "->This .po file is 'GOOD'."
echo ""
fi
done
done
;;
q) exit 0
;;
*) echo "No language chosen. Exiting..."
;;
esac
|