katana/extractpot.sh

42 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
message="$1"
cwd="$(pwd)"
if [ -z "$message" ];then
echo "Pass a path to Messages.sh"
exit 1
elif [ "$(basename $message)" != "Messages.sh" ];then
echo "Path passed is not Messages.sh"
exit 1
2014-12-09 17:58:50 +00:00
elif ! type -p perl ;then
echo "perl is not in your PATH"
exit 1
elif ! type -p xgettext ;then
echo "xgettext is not in your PATH"
exit 1
elif ! type -p msgcat ;then
echo "msgcat is not in your PATH"
exit 1
fi
# the address is temporary
gargs="--from-code=UTF-8 -C -kde \
-ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 \
-kki18np:1,2 -kki18ncp:1c,2,3 --msgid-bugs-address=xakepa10@gmail.com"
2014-12-09 18:13:34 +00:00
export EXTRACTRC="perl $cwd/extractrc.pl" EXTRACTATTR="perl $cwd/extractattr.pl"
export XGETTEXT="$(type -p xgettext) $gargs" XGETTEXT_QT="$(type -p xgettext) $gargs"
export MSGCAT="$(type -p msgcat)"
2014-12-09 18:13:34 +00:00
export podir="$cwd/pots/"
2014-12-09 18:13:34 +00:00
mkdir -pv "$podir"
cd "$(dirname $message)"
source "Messages.sh"
rm -f rc.cpp
2014-12-06 21:32:35 +00:00
echo "All done, use potmerge to merge the files."
echo "You can find them at: $podir"