Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / format-c-3
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test ISO C 99 <inttypes.h> format string directives.
5
6 : ${XGETTEXT=xgettext}
7 ${XGETTEXT} -o fc3.tmp --omit-header --no-location "$abs_srcdir"/format-c-3-prg.c || exit 1
8 LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot || exit 1
9
10 cat <<EOF > fc3.ok
11 #, c-format
12 msgid "father of %<PRId8> children"
13 msgstr ""
14 EOF
15
16 : ${DIFF=diff}
17 ${DIFF} fc3.ok fc3.pot || exit 1
18
19 cat <<EOF > fc3-de.po
20 #, c-format
21 msgid "father of %<PRId8> children"
22 msgstr "Vater von %<PRId8> Kindern"
23 EOF
24
25 test -d fc3-dir || mkdir fc3-dir
26 test -d fc3-dir/de || mkdir fc3-dir/de
27 test -d fc3-dir/de/LC_MESSAGES || mkdir fc3-dir/de/LC_MESSAGES
28
29 : ${MSGFMT=msgfmt}
30 ${MSGFMT} -o fc3-dir/de/LC_MESSAGES/fc3.mo fc3-de.po
31
32 : ${MSGUNFMT=msgunfmt}
33 ${MSGUNFMT} -o fc3-de.po.tmp fc3-dir/de/LC_MESSAGES/fc3.mo || exit 1
34 LC_ALL=C tr -d '\r' < fc3-de.po.tmp > fc3-de.po.un || exit 1
35
36 : ${DIFF=diff}
37 ${DIFF} fc3-de.po fc3-de.po.un || exit 1
38
39 LANGUAGE= ../fc3 de_DE
40 result=$?
41
42 exit $result