forked from jangernert/FeedReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_pot.sh
executable file
·54 lines (48 loc) · 1.25 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
#!/bin/sh
# A modified code from the Terminix project<https://github.com/gnunn1/terminix/>.
DOMAIN=FeedReader
BASEDIR=$(dirname $0)
OUTPUT_FILE=${BASEDIR}/po/${DOMAIN}.pot
echo "Extracting translatable strings... "
find ${BASEDIR}/ -name '*.vala' | xgettext \
--output $OUTPUT_FILE \
--files-from=- \
--directory=$BASEDIR \
--language=Vala \
--keyword=C_:1c,2 \
--from-code=utf-8
--from-code=utf-8
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=Desktop \
${BASEDIR}/data/feedreader.desktop.in
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=Desktop \
${BASEDIR}/data/feedreader-autostart.desktop.in
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=appdata \
${BASEDIR}/data/feedreader.appdata.xml.in
# Merge the messages with existing po files
echo "Merging with existing translations... "
for file in ${BASEDIR}/po/*.po
do
echo -n $file
msgmerge --update $file $OUTPUT_FILE
done