katana/extractpot.sh
Ivailo Monev d038886b98 extractpot.sh: update keywords and remove unused XGETTEXT_QT variable
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-03 12:33:31 +03:00

40 lines
1 KiB
Bash
Executable file

#!/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
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
gargs="--from-code=UTF-8 -C -kde \
-ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 \
-kki18ncp:1c,2,3 --msgid-bugs-address=xakepa10@gmail.com"
export EXTRACTRC="perl $cwd/extractrc.pl" EXTRACTATTR="perl $cwd/extractattr.pl"
export XGETTEXT="$(type -p xgettext) $gargs"
export MSGCAT="$(type -p msgcat)"
export podir="$cwd/pots/"
mkdir -pv "$podir"
cd "$(dirname $message)"
source "Messages.sh"
rm -f rc.cpp
echo "All done, use potmerge to merge the files."
echo "You can find them at: $podir"