No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-objc-2
bloba4f6a2020aafb7c53bb2145dbd845bf8134313c5
1 #!/bin/sh
3 # Test ObjectiveC support: --add-comments option.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-ob-2.m"
9 cat <<EOF > xg-ob-2.m
10 // This comment will not be extracted.
11 print (NSLocalizedString (@
12 "help"));
13 // TRANSLATORS: This is an extracted comment.
14 print (NSLocalizedString (@
15 "me"));
16 /* Not extracted either. */
17 print (NSLocalizedString (@
18 "Hey Jude"));
19 /* TRANSLATORS:
20 Nickname of the Beatles
22 print (NSLocalizedString (@
23 "The Fabulous Four"));
24 /* TRANSLATORS: The strings get concatenated. */
25 print (NSLocalizedString (@ "there is not enough"
26 @" room on a single line for this entire long, " // confusing, eh?
27 @ "verbose string"));
28 EOF
30 tmpfiles="$tmpfiles xg-ob-2.po"
31 : ${XGETTEXT=xgettext}
32 ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
33 xg-ob-2.m -d xg-ob-2
34 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
36 tmpfiles="$tmpfiles xg-ob-2.ok"
37 cat <<EOF > xg-ob-2.ok
38 msgid "help"
39 msgstr ""
41 #. TRANSLATORS: This is an extracted comment.
42 msgid "me"
43 msgstr ""
45 msgid "Hey Jude"
46 msgstr ""
48 #. TRANSLATORS:
49 #. Nickname of the Beatles
51 msgid "The Fabulous Four"
52 msgstr ""
54 #. TRANSLATORS: The strings get concatenated.
55 msgid ""
56 "there is not enough room on a single line for this entire long, verbose "
57 "string"
58 msgstr ""
59 EOF
61 : ${DIFF=diff}
62 ${DIFF} xg-ob-2.ok xg-ob-2.po
63 result=$?
65 rm -fr $tmpfiles
67 exit $result