1
0
Fork 0

fix merge function of util/run_xgettext.sh

This commit is contained in:
Johannes Schwab 2015-01-08 13:59:42 +01:00
commit 1a8ea8ba14
2 changed files with 11 additions and 16 deletions

View file

@ -30,18 +30,6 @@ F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.p
echo "Friendica version $F9KVERSION"
OPTS=
#if [ "" != "$1" ]
#then
# OUTFILE="$(readlink -f ${FULLPATH}/$1)"
# if [ -e "$OUTFILE" ]
# then
# echo "join extracted strings"
# OPTS="-j"
# fi
#fi
KEYWORDS="-k -kt -ktt:1,2"
echo "extract strings to $OUTFILE.."
@ -50,7 +38,7 @@ for f in $(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f)
do
if [ ! -d "$f" ]
then
xgettext $KEYWORDS $OPTS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
xgettext $KEYWORDS -j -o "$OUTFILE" --from-code=UTF-8 "$f"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
fi
done
@ -75,4 +63,11 @@ else
sed -i "s/^\"Plural-Forms.*$//g" "$OUTFILE"
fi
if [ "" != "$1" -a "$ADDONMODE" == "" ]
then
UPDATEFILE="$(readlink -f ${FULLPATH}/$1)"
echo "merging new strings to $UPDATEFILE.."
msgmerge -U $OUTFILE $UPDATEFILE
fi
echo "done."