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