Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #!/bin/sh
      2  1.1  christos 
      3  1.1  christos # More tests for C# support: UTF-8 encoded source files
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles xg-cs-2.cs"
      9  1.1  christos cat <<\EOF > xg-cs-2.cs
     10  1.1  christos class TestCase {
     11  1.1  christos   public static void Main (String[] args) {
     12  1.1  christos     Console.WriteLine(GetString("Russian (): "));
     13  1.1  christos     Console.WriteLine(GetString("Vietnamese (Ting Vit): Cho bn"));
     14  1.1  christos     Console.WriteLine(GetString("Japanese (): "));
     15  1.1  christos     Console.WriteLine(GetString("Thai (): "));
     16  1.1  christos     Console.WriteLine(GetString("Script: "));
     17  1.1  christos     Console.WriteLine(GetString("Russian (\u0420\u0443\u0441\u0441\u043a\u0438\u0439): \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435"));
     18  1.1  christos     Console.WriteLine(GetString("Vietnamese (Ti\u1ebfng Vi\u1ec7t): Ch\u00e0o b\u1ea1n"));
     19  1.1  christos     Console.WriteLine(GetString("Japanese (\u65e5\u672c\u8a9e): \u3053\u3093\u306b\u3061\u306f"));
     20  1.1  christos     Console.WriteLine(GetString("Thai (\u0e20\u0e32\u0e29\u0e32\u0e44\u0e17\u0e22): \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35\u0e04\u0e23\u0e31\u0e1a"));
     21  1.1  christos     Console.WriteLine(GetString("Script: \U0001d49e"));
     22  1.1  christos     // And now a comment with  and  and Unicode escapes: B\u00f6se B\u00fcbchen
     23  1.1  christos     Console.WriteLine(GetString("This string has a multilingual comment"));
     24  1.1  christos   }
     25  1.1  christos }
     26  1.1  christos EOF
     27  1.1  christos 
     28  1.1  christos tmpfiles="$tmpfiles xg-cs-2.po"
     29  1.1  christos : ${XGETTEXT=xgettext}
     30  1.1  christos # delete POT-Creation-Date: line because the date depends on local time.
     31  1.1  christos ${XGETTEXT} --output - --add-location -c --from-code=UTF-8 xg-cs-2.cs \
     32  1.1  christos   | sed '/\"POT-Creation-Date:.*/d' > xg-cs-2.po
     33  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     34  1.1  christos 
     35  1.1  christos tmpfiles="$tmpfiles xg-cs-2.ok"
     36  1.1  christos cat <<\EOF > xg-cs-2.ok
     37  1.1  christos # SOME DESCRIPTIVE TITLE.
     38  1.1  christos # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
     39  1.1  christos # This file is distributed under the same license as the PACKAGE package.
     40  1.1  christos # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     41  1.1  christos #
     42  1.1  christos #, fuzzy
     43  1.1  christos msgid ""
     44  1.1  christos msgstr ""
     45  1.1  christos "Project-Id-Version: PACKAGE VERSION\n"
     46  1.1  christos "Report-Msgid-Bugs-To: \n"
     47  1.1  christos "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     48  1.1  christos "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     49  1.1  christos "Language-Team: LANGUAGE <LL (at] li.org>\n"
     50  1.1  christos "MIME-Version: 1.0\n"
     51  1.1  christos "Content-Type: text/plain; charset=UTF-8\n"
     52  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     53  1.1  christos 
     54  1.1  christos #: xg-cs-2.cs:3 xg-cs-2.cs:8
     55  1.1  christos msgid "Russian (): "
     56  1.1  christos msgstr ""
     57  1.1  christos 
     58  1.1  christos #: xg-cs-2.cs:4 xg-cs-2.cs:9
     59  1.1  christos msgid "Vietnamese (Ting Vit): Cho bn"
     60  1.1  christos msgstr ""
     61  1.1  christos 
     62  1.1  christos #: xg-cs-2.cs:5 xg-cs-2.cs:10
     63  1.1  christos msgid "Japanese (): "
     64  1.1  christos msgstr ""
     65  1.1  christos 
     66  1.1  christos #: xg-cs-2.cs:6 xg-cs-2.cs:11
     67  1.1  christos msgid "Thai (): "
     68  1.1  christos msgstr ""
     69  1.1  christos 
     70  1.1  christos #: xg-cs-2.cs:7 xg-cs-2.cs:12
     71  1.1  christos msgid "Script: "
     72  1.1  christos msgstr ""
     73  1.1  christos 
     74  1.1  christos #. And now a comment with  and  and Unicode escapes: B\u00f6se B\u00fcbchen
     75  1.1  christos #: xg-cs-2.cs:14
     76  1.1  christos msgid "This string has a multilingual comment"
     77  1.1  christos msgstr ""
     78  1.1  christos EOF
     79  1.1  christos 
     80  1.1  christos : ${DIFF=diff}
     81  1.1  christos ${DIFF} xg-cs-2.ok xg-cs-2.po
     82  1.1  christos result=$?
     83  1.1  christos 
     84  1.1  christos rm -fr $tmpfiles
     85  1.1  christos 
     86  1.1  christos exit $result
     87