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