forked from bilelmoussaoui/Icon-Requests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_pot.sh
executable file
·57 lines (50 loc) · 1.3 KB
/
update_pot.sh
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
#!/bin/sh
# A modified code from the Terminix project<https://github.com/gnunn1/terminix/>.
DOMAIN=icon-requests
BASEDIR=$(dirname $0)
OUTPUT_FILE=${BASEDIR}/po/${DOMAIN}.pot
echo "Extracting translatable strings... "
find ${BASEDIR}/ -name '*.py' | xgettext \
--output $OUTPUT_FILE \
--files-from=- \
--directory=$BASEDIR \
--language=Python \
--keyword=C_:1c,2 \
--from-code=utf-8
find ${BASEDIR}/ -name '*.ui' | xgettext \
--output $OUTPUT_FILE \
--join-existing \
--files-from=- \
--directory=$BASEDIR \
--language=Glade \
--foreign-user \
--keyword=C_:1c,2 \
--from-code=utf-8
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=Desktop \
${BASEDIR}/data/icon-requests.desktop.in
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=appdata \
${BASEDIR}/data/icon-requests.appdata.xml.in
# Merge the messages with existing po files
po_files=$(find ${BASEDIR}/po/ -name "*.po")
if [ ${#po_files[@]} != 0 ]; then
echo "Merging with existing translations..."
for file in $po_files
do
echo -n $file
msgmerge --update $file $OUTPUT_FILE
done
fi