Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-csharp-2
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # More tests for C# support: UTF-8 encoded source files
5
6 cat <<\EOF > xg-cs-2.cs
7 class TestCase {
8   public static void Main (String[] args) {
9     Console.WriteLine(GetString("Russian (Русский): Здравствуйте"));
10     Console.WriteLine(GetString("Vietnamese (Tiếng Việt): Chào bạn"));
11     Console.WriteLine(GetString("Japanese (日本語): こんにちは"));
12     Console.WriteLine(GetString("Thai (ภาษาไทย): สวัสดีครับ"));
13     Console.WriteLine(GetString("Script: 𝒞"));
14     Console.WriteLine(GetString("Russian (\u0420\u0443\u0441\u0441\u043a\u0438\u0439): \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435"));
15     Console.WriteLine(GetString("Vietnamese (Ti\u1ebfng Vi\u1ec7t): Ch\u00e0o b\u1ea1n"));
16     Console.WriteLine(GetString("Japanese (\u65e5\u672c\u8a9e): \u3053\u3093\u306b\u3061\u306f"));
17     Console.WriteLine(GetString("Thai (\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22): \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e04\u0e23\u0e31\u0e1a"));
18     Console.WriteLine(GetString("Script: \U0001d49e"));
19     // And now a comment with Русский and 日本語 and Unicode escapes: B\u00f6se B\u00fcbchen
20     Console.WriteLine(GetString("This string has a multilingual comment"));
21     // Unicode identifiers.
22     String あ = "";
23     String 𐀀 = "";
24     int \u65e5\u672c\u8a9e = 1;
25   }
26 }
27 EOF
28
29 : ${XGETTEXT=xgettext}
30 # delete POT-Creation-Date: line because the date depends on local time.
31 ${XGETTEXT} --output - --add-location -c --from-code=UTF-8 xg-cs-2.cs \
32   | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-2.po || exit 1
33
34 cat <<\EOF > xg-cs-2.ok
35 # SOME DESCRIPTIVE TITLE.
36 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
37 # This file is distributed under the same license as the PACKAGE package.
38 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
39 #
40 #, fuzzy
41 msgid ""
42 msgstr ""
43 "Project-Id-Version: PACKAGE VERSION\n"
44 "Report-Msgid-Bugs-To: \n"
45 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
46 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
47 "Language-Team: LANGUAGE <LL@li.org>\n"
48 "Language: \n"
49 "MIME-Version: 1.0\n"
50 "Content-Type: text/plain; charset=UTF-8\n"
51 "Content-Transfer-Encoding: 8bit\n"
52
53 #: xg-cs-2.cs:3 xg-cs-2.cs:8
54 msgid "Russian (Русский): Здравствуйте"
55 msgstr ""
56
57 #: xg-cs-2.cs:4 xg-cs-2.cs:9
58 msgid "Vietnamese (Tiếng Việt): Chào bạn"
59 msgstr ""
60
61 #: xg-cs-2.cs:5 xg-cs-2.cs:10
62 msgid "Japanese (日本語): こんにちは"
63 msgstr ""
64
65 #: xg-cs-2.cs:6 xg-cs-2.cs:11
66 msgid "Thai (ภาษาไทย): สวัสดีครับ"
67 msgstr ""
68
69 #: xg-cs-2.cs:7 xg-cs-2.cs:12
70 msgid "Script: 𝒞"
71 msgstr ""
72
73 #. And now a comment with Русский and 日本語 and Unicode escapes: B\u00f6se B\u00fcbchen
74 #: xg-cs-2.cs:14
75 msgid "This string has a multilingual comment"
76 msgstr ""
77 EOF
78
79 : ${DIFF=diff}
80 ${DIFF} xg-cs-2.ok xg-cs-2.po
81 result=$?
82
83 exit $result