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