1 1.1 christos #!/bin/sh 2 1.1 christos 3 1.1 christos # Test C 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-c-9.c" 9 1.1 christos cat <<EOF > xg-c-9.c 10 1.1 christos // This comment will not be extracted. 11 1.1 christos print (gettext ("help")); 12 1.1 christos // TRANSLATORS: This is an extracted comment. 13 1.1 christos print (gettext ("me")); 14 1.1 christos /* Not extracted either. */ 15 1.1 christos print (gettext ("Hey Jude")); 16 1.1 christos /* TRANSLATORS: 17 1.1 christos Nickname of the Beatles 18 1.1 christos */ 19 1.1 christos print (gettext ("The Fabulous Four")); 20 1.1 christos /* TRANSLATORS: The strings get concatenated. */ 21 1.1 christos print (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-c-9.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-c-9 xg-c-9.c 30 1.1 christos test $? = 0 || { rm -fr $tmpfiles; exit 1; } 31 1.1 christos 32 1.1 christos tmpfiles="$tmpfiles xg-c-9.ok" 33 1.1 christos cat <<EOF > xg-c-9.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-c-9.ok xg-c-9.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