• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#!/bin/sh
2
3# More tests for C# support: UTF-8 encoded source files
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-cs-2.cs"
9cat <<\EOF > xg-cs-2.cs
10class 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}
26EOF
27
28tmpfiles="$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' | tr -d '\r' > xg-cs-2.po
33test $? = 0 || { rm -fr $tmpfiles; exit 1; }
34
35tmpfiles="$tmpfiles xg-cs-2.ok"
36cat <<\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
43msgid ""
44msgstr ""
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"MIME-Version: 1.0\n"
51"Content-Type: text/plain; charset=UTF-8\n"
52"Content-Transfer-Encoding: 8bit\n"
53
54#: xg-cs-2.cs:3 xg-cs-2.cs:8
55msgid "Russian (��������������): ������������������������"
56msgstr ""
57
58#: xg-cs-2.cs:4 xg-cs-2.cs:9
59msgid "Vietnamese (Ti���ng Vi���t): Ch��o b���n"
60msgstr ""
61
62#: xg-cs-2.cs:5 xg-cs-2.cs:10
63msgid "Japanese (���������): ���������������"
64msgstr ""
65
66#: xg-cs-2.cs:6 xg-cs-2.cs:11
67msgid "Thai (���������������������): ������������������������������"
68msgstr ""
69
70#: xg-cs-2.cs:7 xg-cs-2.cs:12
71msgid "Script: ����"
72msgstr ""
73
74#. And now a comment with �������������� and ��������� and Unicode escapes: B\u00f6se B\u00fcbchen
75#: xg-cs-2.cs:14
76msgid "This string has a multilingual comment"
77msgstr ""
78EOF
79
80: ${DIFF=diff}
81${DIFF} xg-cs-2.ok xg-cs-2.po
82result=$?
83
84rm -fr $tmpfiles
85
86exit $result
87