summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-csharp-2
blob: cf8d4a248a96456a53e0fb87c9fdfcdf4b01ae07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# More tests for C# support: UTF-8 encoded source files

cat <<\EOF > xg-cs-2.cs
class TestCase {
  public static void Main (String[] args) {
    Console.WriteLine(GetString("Russian (Русский): Здравствуйте"));
    Console.WriteLine(GetString("Vietnamese (Tiếng Việt): Chào bạn"));
    Console.WriteLine(GetString("Japanese (日本語): こんにちは"));
    Console.WriteLine(GetString("Thai (ภาษาไทย): สวัสดีครับ"));
    Console.WriteLine(GetString("Script: 𝒞"));
    Console.WriteLine(GetString("Russian (\u0420\u0443\u0441\u0441\u043a\u0438\u0439): \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435"));
    Console.WriteLine(GetString("Vietnamese (Ti\u1ebfng Vi\u1ec7t): Ch\u00e0o b\u1ea1n"));
    Console.WriteLine(GetString("Japanese (\u65e5\u672c\u8a9e): \u3053\u3093\u306b\u3061\u306f"));
    Console.WriteLine(GetString("Thai (\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22): \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e04\u0e23\u0e31\u0e1a"));
    Console.WriteLine(GetString("Script: \U0001d49e"));
    // And now a comment with Русский and 日本語 and Unicode escapes: B\u00f6se B\u00fcbchen
    Console.WriteLine(GetString("This string has a multilingual comment"));
    // Unicode identifiers.
    String あ = "";
    String 𐀀 = "";
    int \u65e5\u672c\u8a9e = 1;
  }
}
EOF

: ${XGETTEXT=xgettext}
# delete POT-Creation-Date: line because the date depends on local time.
${XGETTEXT} --output - --add-location -c --from-code=UTF-8 xg-cs-2.cs \
  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-2.po || exit 1

cat <<\EOF > xg-cs-2.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: xg-cs-2.cs:3 xg-cs-2.cs:8
msgid "Russian (Русский): Здравствуйте"
msgstr ""

#: xg-cs-2.cs:4 xg-cs-2.cs:9
msgid "Vietnamese (Tiếng Việt): Chào bạn"
msgstr ""

#: xg-cs-2.cs:5 xg-cs-2.cs:10
msgid "Japanese (日本語): こんにちは"
msgstr ""

#: xg-cs-2.cs:6 xg-cs-2.cs:11
msgid "Thai (ภาษาไทย): สวัสดีครับ"
msgstr ""

#: xg-cs-2.cs:7 xg-cs-2.cs:12
msgid "Script: 𝒞"
msgstr ""

#. And now a comment with Русский and 日本語 and Unicode escapes: B\u00f6se B\u00fcbchen
#: xg-cs-2.cs:14
msgid "This string has a multilingual comment"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-cs-2.ok xg-cs-2.po
result=$?

exit $result