/usr/share/kadu/sdk/translations/plugintsupdate.sh is in kadu-dev 4.1-1.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/usr/bin/env bash
echo "Updating translation files in '$1'..."
pushd "$1" 2>&1 > /dev/null
DIR=`dirname "$0"`
PLUGIN=`basename "$(pwd)"`
XSLT_PROCESSOR=$(which saxon-xslt) || XSLT_PROCESSOR=$(which saxon8) || XSLT_PROCESSOR=$(which xt) || XSLT_PROCESSOR=saxon-xslt
LUPDATE=$(which lupdate-qt5) || LUPDATE=$(which lupdate) || LUPDATE=$QTDIR/bin/lupdate
if [ ! -f $PLUGIN.desc ]; then
echo "This is not a plugin directory."
exit 1;
fi
UI_TRANS=""
if [ -d configuration ]; then
UI_TRANS=.configuration-ui-translations.cpp
pushd configuration 2>&1 > /dev/null
echo > ../.configuration-ui-translations.cpp
for i in *.ui; do
$XSLT_PROCESSOR $i $DIR/configuration-ui.xsl >> ../.configuration-ui-translations.cpp
done
popd 2>&1 > /dev/null
fi
if [ -d data/configuration ]; then
UI_TRANS=.configuration-ui-translations.cpp
pushd data/configuration 2>&1 > /dev/null
echo > ../../.configuration-ui-translations.cpp
for i in *.ui; do
$XSLT_PROCESSOR $i $DIR/configuration-ui.xsl >> ../../.configuration-ui-translations.cpp
done
popd 2>&1 > /dev/null
fi
if [ ! -d translations ]; then
mkdir translations;
fi
SRC_FILES=`find . -type f -name "*.cpp"`
for ts in translations/*.ts; do
$LUPDATE -locations none -noobsolete -verbose $SRC_FILES ${UI_TRANS} -ts $ts || \
( rm $ts && $LUPDATE -locations none -noobsolete -verbose $SRC_FILES ${UI_TRANS} -ts $ts )
done
if [ ! -f translations/${PLUGIN}_en.ts ]; then
$LUPDATE -locations none -noobsolete -verbose $SRC_FILES ${UI_TRANS} -ts translations/${PLUGIN}_en.ts || \
( rm translations/${PLUGIN}_en.ts && $LUPDATE -locations none -noobsolete -verbose $SRC_FILES ${UI_TRANS} -ts translations/${PLUGIN}_en.ts )
fi
popd 2>&1 > /dev/null
|