2 # This script reads a .desktop file from stdin and prints the same file, with
3 # up-to-date translations, to stdout.
7 if echo $line | grep '^.*\[.*\]=' > /dev/null; then
13 # Generate translations if current line is translatable
14 if echo $line | grep '^Comment=' > /dev/null; then
15 msgid=`echo $line | sed 's/^Comment=//'`
17 lang=`basename $i | sed 's/\.po//'`
18 msgstr=`msgattrib --translated --no-obsolete --no-fuzzy $i \
19 | msggrep --no-location --no-wrap --msgid -F -e "$msgid" \
20 | tail -n 1 | sed 's/^msgstr "\(.*\)"$/\1/'`
21 if [ "$msgstr" != "" ]; then
22 echo "Comment[$lang]=$msgstr"