1#!/bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test Python support: --add-comments option. 5 6cat <<EOF > xg-py-2.py 7# This comment will not be extracted. 8print gettext.gettext("help") 9# TRANSLATORS: This is an extracted comment. 10print gettext.gettext("me") 11# Not extracted either. 12print gettext.gettext("Hey Jude") 13# TRANSLATORS: 14# Nickname of the Beatles 15print gettext.gettext("The Fabulous Four") 16# TRANSLATORS: The strings get concatenated. 17print gettext.gettext("there is not enough" 18" room on a single line for this entire long, " # confusing, eh? 19"verbose string") 20EOF 21 22: ${XGETTEXT=xgettext} 23${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ 24 -d xg-py-2.tmp xg-py-2.py || Exit 1 25LC_ALL=C tr -d '\r' < xg-py-2.tmp.po > xg-py-2.po || Exit 1 26 27cat <<EOF > xg-py-2.ok 28msgid "help" 29msgstr "" 30 31#. TRANSLATORS: This is an extracted comment. 32msgid "me" 33msgstr "" 34 35msgid "Hey Jude" 36msgstr "" 37 38#. TRANSLATORS: 39#. Nickname of the Beatles 40msgid "The Fabulous Four" 41msgstr "" 42 43#. TRANSLATORS: The strings get concatenated. 44msgid "" 45"there is not enough room on a single line for this entire long, verbose " 46"string" 47msgstr "" 48EOF 49 50: ${DIFF=diff} 51${DIFF} xg-py-2.ok xg-py-2.po 52result=$? 53 54exit $result 55