]> git.mxchange.org Git - friendica.git/blob - util/run_xgettext.sh
rev update
[friendica.git] / util / run_xgettext.sh
1 #!/bin/bash
2
3 FULLPATH=$(dirname $(readlink -f "$0"))
4 cd "$FULLPATH/../view/en/"
5
6 F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.php);
7
8 echo "Friendica version $F9KVERSION"
9
10 OPTS=
11 OUTFILE="$FULLPATH/messages.po"
12 if [ "" != "$1" ]
13 then
14         OUTFILE="$(readlink -f ${FULLPATH}/$1)"
15         if [ -e "$OUTFILE" ]
16         then
17                 echo "join extracted strings"
18                 OPTS="-j"
19         fi
20 fi
21
22 KEYWORDS="-k -kt -ktt:1,2"
23
24 echo "extract strings to $OUTFILE.."
25 find ../../ -name "*.php" | xargs xgettext $KEYWORDS $OPTS -o "$OUTFILE" --from-code=UTF-8
26
27 echo "setup base info.."
28 sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE"
29 sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011 the Friendica Project/g" "$OUTFILE"
30 sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
31 sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
32 sed -i "s/PACKAGE/Friendica/g" "$OUTFILE"
33 sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
34 sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
35
36
37 echo "done."