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