2021-06-22 12:40:31 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-11-13 01:04:59 +02:00
|
|
|
# little script to extract the text from the tips file
|
|
|
|
# and output it, so xgettext can add the tips to the po file
|
|
|
|
#
|
2021-06-22 12:40:31 +03:00
|
|
|
# 2021 by Ivailo Monev <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
# IMPORTANT NOTE: Do not change the output without checking if
|
|
|
|
# translations still work!
|
|
|
|
|
2021-06-22 12:40:31 +03:00
|
|
|
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
|