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