blob: 710ebabd09a66e09c3166b3a118ab61cbb671aef (
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
|
#!/bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test of Shell support: bash $(...) syntax.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles xg-sh-5.sh"
cat <<\EOF > xg-sh-5.sh
echo $(gettext 'Simple string')
echo "$(gettext 'Simple string inside double-quotes')"
echo $(gettext 'Simple decorated string: "x" \"y\"')
echo "$(gettext 'Simple decorated string: "x" \"y\" inside double-quotes')"
echo $(gettext "Simple dstring")
echo "$(gettext "Simple dstring inside double-quotes")"
echo $(gettext "Simple decorated dstring: \"x\" \\\"y\\\"")
echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")"
EOF
tmpfiles="$tmpfiles xg-sh-5.tmp.po xg-sh-5.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-sh-5.tmp xg-sh-5.sh
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
LC_ALL=C tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles xg-sh-5.ok"
cat <<\EOF > xg-sh-5.ok
msgid "Simple string"
msgstr ""
msgid "Simple string inside double-quotes"
msgstr ""
msgid "Simple decorated string: \"x\" \\\"y\\\""
msgstr ""
msgid "Simple decorated string: \"x\" \\\"y\\\" inside double-quotes"
msgstr ""
msgid "Simple dstring"
msgstr ""
msgid "Simple dstring inside double-quotes"
msgstr ""
msgid "Simple decorated dstring: \"x\" \\\"y\\\""
msgstr ""
msgid "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-sh-5.ok xg-sh-5.po
result=$?
rm -fr $tmpfiles
exit $result
|