• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test msgen on a POT file with contexts.
5
6cat <<\EOF > men-test3.pot
7msgid ""
8msgstr ""
9"Content-Type: text/plain; charset=UTF-8\n"
10"Content-Transfer-Encoding: 8bit\n"
11
12#. A menu item
13msgctxt "File|"
14msgid "Open"
15msgstr ""
16
17#. A menu item
18msgctxt "File|"
19msgid "New"
20msgstr ""
21
22#. Denote a lock's state
23msgctxt "Lock state"
24msgid "Open"
25msgstr ""
26
27#. Denote a lock's state
28msgctxt "Lock state"
29msgid "Closed"
30msgstr ""
31
32#. A product
33msgctxt "Audi"
34msgid "car"
35msgstr ""
36
37#. A product
38msgctxt "Océ"
39msgid "copier"
40msgstr ""
41EOF
42
43: ${MSGEN=msgen}
44${MSGEN} -o men-test3.tmp men-test3.pot || Exit 1
45LC_ALL=C tr -d '\r' < men-test3.tmp > men-test3.out || Exit 1
46
47cat <<\EOF > men-test3.ok
48msgid ""
49msgstr ""
50"Content-Type: text/plain; charset=UTF-8\n"
51"Content-Transfer-Encoding: 8bit\n"
52
53#. A menu item
54msgctxt "File|"
55msgid "Open"
56msgstr "Open"
57
58#. A menu item
59msgctxt "File|"
60msgid "New"
61msgstr "New"
62
63#. Denote a lock's state
64msgctxt "Lock state"
65msgid "Open"
66msgstr "Open"
67
68#. Denote a lock's state
69msgctxt "Lock state"
70msgid "Closed"
71msgstr "Closed"
72
73#. A product
74msgctxt "Audi"
75msgid "car"
76msgstr "car"
77
78#. A product
79msgctxt "Océ"
80msgid "copier"
81msgstr "copier"
82EOF
83
84: ${DIFF=diff}
85${DIFF} men-test3.ok men-test3.out
86result=$?
87
88exit $result
89