blob: 6a34a84f416eceaa25a294b5b6136c5267ff816f (
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
|
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test ISO C 99 <inttypes.h> format string directives with plural forms.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles fc4.tmp fc4.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o fc4.tmp --omit-header --no-location ../${srcdir}/format-c-4-prg.c
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
LC_ALL=C tr -d '\r' < fc4.tmp > fc4.pot
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles fc4.ok"
cat <<EOF > fc4.ok
#, c-format
msgid "father of %<PRId8> child"
msgid_plural "father of %<PRId8> children"
msgstr[0] ""
msgstr[1] ""
EOF
: ${DIFF=diff}
${DIFF} fc4.ok fc4.pot || exit 1
tmpfiles="$tmpfiles fc4-de.po"
cat <<EOF > fc4-de.po
#, c-format
msgid "father of %<PRId8> child"
msgid_plural "father of %<PRId8> children"
msgstr[0] "Vater eines Kindes"
msgstr[1] "Vater von %<PRId8> Kindern"
EOF
tmpfiles="$tmpfiles fc4-dir"
test -d fc4-dir || mkdir fc4-dir
test -d fc4-dir/de || mkdir fc4-dir/de
test -d fc4-dir/de/LC_MESSAGES || mkdir fc4-dir/de/LC_MESSAGES
: ${MSGFMT=msgfmt}
${MSGFMT} -o fc4-dir/de/LC_MESSAGES/fc4.mo fc4-de.po
tmpfiles="$tmpfiles fc4-de.po.tmp fc4-de.po.un"
: ${MSGUNFMT=msgunfmt}
${MSGUNFMT} -o fc4-de.po.tmp fc4-dir/de/LC_MESSAGES/fc4.mo
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
LC_ALL=C tr -d '\r' < fc4-de.po.tmp > fc4-de.po.un
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
: ${DIFF=diff}
${DIFF} fc4-de.po fc4-de.po.un || exit 1
LANGUAGE= ../fc4 de_DE
result=$?
rm -fr $tmpfiles
exit $result
|