Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/locale/merge-po.sh
blob: 1b6d445124f5c32362d11b4562a1604058c20adb (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 "*.po"`; do
    sed 's/#\. /# developer_comment /' "$lang" | msgmerge --no-fuzzy-matching - $1 > $TMPFILE
    sed 's/# developer_comment /#. /' "$TMPFILE" > "$lang"
done
rm "$TMPFILE"