summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/format-c-3
blob: b72da21afc48b0a90f23eb92c851e1ea27569c51 (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
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test ISO C 99 <inttypes.h> format string directives.

: ${XGETTEXT=xgettext}
${XGETTEXT} -o fc3.tmp --omit-header --no-location "$abs_srcdir"/format-c-3-prg.c || exit 1
LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot || exit 1

cat <<EOF > fc3.ok
#, c-format
msgid "father of %<PRId8> children"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} fc3.ok fc3.pot || exit 1

cat <<EOF > fc3-de.po
#, c-format
msgid "father of %<PRId8> children"
msgstr "Vater von %<PRId8> Kindern"
EOF

test -d fc3-dir || mkdir fc3-dir
test -d fc3-dir/de || mkdir fc3-dir/de
test -d fc3-dir/de/LC_MESSAGES || mkdir fc3-dir/de/LC_MESSAGES

: ${MSGFMT=msgfmt}
${MSGFMT} -o fc3-dir/de/LC_MESSAGES/fc3.mo fc3-de.po

: ${MSGUNFMT=msgunfmt}
${MSGUNFMT} -o fc3-de.po.tmp fc3-dir/de/LC_MESSAGES/fc3.mo || exit 1
LC_ALL=C tr -d '\r' < fc3-de.po.tmp > fc3-de.po.un || exit 1

: ${DIFF=diff}
${DIFF} fc3-de.po fc3-de.po.un || exit 1

LANGUAGE= ../fc3 de_DE
result=$?

exit $result