KissCount/tools/generate_locales.sh

26 lines
576 B
Bash
Executable File

#!/bin/bash
function check_tool()
{
which $1 > /dev/null
if [ $? == 1 ] ; then
echo "$1 is missing" ;
exit 1
fi
}
for p in find xgettext poeditor lconvert lrelease ; do
check_tool $p
done
CPP_FILE_LIST=`find src -name '*.cpp' -print`
xgettext --from-code utf-8 -d kisscount -s --keyword=_ -p ./resources/po -o kisscount.pot $CPP_FILE_LIST
for po in ./resources/po/*.po ; do
ts=`echo $po | sed s/po$/ts/`
poeditor $po
echo lconvert -locations relative $po -o $ts
lconvert -locations relative $po -o $ts
lrelease $ts
rm -f $ts
done