1#!/bin/sh 2 3# Test EmacsLisp support: --add-comments option. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8tmpfiles="$tmpfiles xg-el-1.el" 9cat <<EOF > xg-el-1.el 10; This comment will not be extracted. 11(princ (_ "help")) 12;; TRANSLATORS: This is an extracted comment. 13(princ (_ "me")) 14; Not extracted either. 15(princ (_ "Hey Jude")) 16; TRANSLATORS: 17; Nickname of the Beatles 18(princ (_ "The Fabulous Four")) 19EOF 20 21tmpfiles="$tmpfiles xg-el-1.tmp.po xg-el-1.po" 22: ${XGETTEXT=xgettext} 23${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ 24 -d xg-el-1.tmp xg-el-1.el 25test $? = 0 || { rm -fr $tmpfiles; exit 1; } 26tr -d '\r' < xg-el-1.tmp.po > xg-el-1.po 27test $? = 0 || { rm -fr $tmpfiles; exit 1; } 28 29tmpfiles="$tmpfiles xg-el-1.ok" 30cat <<EOF > xg-el-1.ok 31msgid "help" 32msgstr "" 33 34#. TRANSLATORS: This is an extracted comment. 35msgid "me" 36msgstr "" 37 38msgid "Hey Jude" 39msgstr "" 40 41#. TRANSLATORS: 42#. Nickname of the Beatles 43msgid "The Fabulous Four" 44msgstr "" 45EOF 46 47: ${DIFF=diff} 48${DIFF} xg-el-1.ok xg-el-1.po 49result=$? 50 51rm -fr $tmpfiles 52 53exit $result 54