kdelibs/kdeui/preparetips
Ivailo Monev 5916fef870 kdeui: rewrite preparetips as shell script
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2021-06-22 12:40:31 +03:00

26 lines
673 B
Bash
Executable file

#!/bin/sh
# little script to extract the text from the tips file
# and output it, so xgettext can add the tips to the po file
#
# 2021 by Ivailo Monev <xakepa10@gmail.com>
# IMPORTANT NOTE: Do not change the output without checking if
# translations still work!
intip="no"
while read line;do
if echo "$line" | grep -q '<html>';then
intip="yes"
echo "// i18n: ectx: @info:tipoftheday";
printf "i18n(";
continue
elif echo "$line" | grep -q '</html>';then
intip="no"
echo ");";
fi
if [ "$intip" = "yes" ];then
echo "\""$(echo "$line" | sed -e 's|"|\\"|g' -e 's|\\|\\\\|g')"\\\n\""
fi
done < tips