forked from gnunn1/tilix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextract-strings.sh
executable file
·72 lines (64 loc) · 1.77 KB
/
extract-strings.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
DOMAIN=tilix
BASEDIR=$(dirname $0)
OUTPUT_FILE=${BASEDIR}/po/${DOMAIN}.pot
echo "Extracting translatable strings... "
# Extract the strings from D source code. Since xgettext does not support D
# as a language we use Vala, which works reasonable well.
find ${BASEDIR}/source -name '*.d' | xgettext \
--output $OUTPUT_FILE \
--files-from=- \
--directory=$BASEDIR \
--language=Vala \
--keyword=C_:1c,2 \
--from-code=utf-8 \
--add-comments=TRANSLATORS
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--directory=$BASEDIR \
${BASEDIR}/data/nautilus/open-tilix.py
# Glade UI Files
find ${BASEDIR}/data/resources/ui -name '*.ui' | xgettext \
--join-existing \
--output $OUTPUT_FILE \
--files-from=- \
--directory=$BASEDIR \
--language=Glade \
--from-code=utf-8
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=Desktop \
${BASEDIR}/data/pkg/desktop/com.gexperts.Tilix.desktop.in
xgettext \
--join-existing \
--output $OUTPUT_FILE \
--default-domain=$DOMAIN \
--package-name=$DOMAIN \
--directory=$BASEDIR \
--foreign-user \
--language=appdata \
${BASEDIR}/data/appdata/com.gexperts.Tilix.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
# Update manpage translations
echo "Updating manpage translations..."
if type po4a-updatepo >/dev/null 2>&1; then
MANDIR=${BASEDIR}/data/man
po4a-gettextize -f man -m ${MANDIR}/tilix -p ${MANDIR}/po/tilix.man.pot
for file in ${MANDIR}/po/*.man.po
do
echo -n $file
po4a-updatepo -f man -m ${MANDIR}/tilix -p $file
done
fi