blob: ea1c5798ed962739d1be7ca49a6d585d8d05f425 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
# syntax:
# merge-po.sh extracted.pot destination-dir/
function usage() {
echo "syntax:"
echo "merge-po.sh extracted.pot destination-dir/"
exit 1
}
tempfoo=`basename $0`
TMPFILE=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1
# check if file and dir are there
if [[ ($# -ne 2) || (! -f "$1") || (! -d "$2") ]]; then usage; fi
for lang in `find $2 -type f -name "messages.po"`; do
sed 's/#\. /# developer_comment /' "$lang" | msgmerge --no-fuzzy-matching - $1 > $TMPFILE
sed 's/# developer_comment /#. /' "$TMPFILE" > "$lang"
done
rm "$TMPFILE"
|