No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / format-c-4
blob78fa50a0785dd9e29f25601daefa1020c7983451
1 #! /bin/sh
3 # Test ISO C 99 <inttypes.h> format string directives with plural forms.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles fc4.pot"
9 : ${XGETTEXT=xgettext}
10 ${XGETTEXT} -o fc4.pot --omit-header --no-location ${top_srcdir}/tests/format-c-4-prg.c
12 tmpfiles="$tmpfiles fc4.ok"
13 cat <<EOF > fc4.ok
14 #, c-format
15 msgid "father of %<PRId8> child"
16 msgid_plural "father of %<PRId8> children"
17 msgstr[0] ""
18 msgstr[1] ""
19 EOF
21 : ${DIFF=diff}
22 ${DIFF} fc4.ok fc4.pot || exit 1
24 tmpfiles="$tmpfiles de.po"
25 cat <<EOF > de.po
26 #, c-format
27 msgid "father of %<PRId8> child"
28 msgid_plural "father of %<PRId8> children"
29 msgstr[0] "Vater eines Kindes"
30 msgstr[1] "Vater von %<PRId8> Kindern"
31 EOF
33 tmpfiles="$tmpfiles de"
34 test -d de || mkdir de
35 test -d de/LC_MESSAGES || mkdir de/LC_MESSAGES
37 : ${MSGFMT=msgfmt}
38 ${MSGFMT} -o de/LC_MESSAGES/fc4.mo de.po
40 tmpfiles="$tmpfiles de.po.tmp"
41 : ${MSGUNFMT=msgunfmt}
42 ${MSGUNFMT} de/LC_MESSAGES/fc4.mo -o de.po.tmp
44 tmpfiles="$tmpfiles de.po.strip"
45 sed 1d < de.po > de.po.strip
47 : ${DIFF=diff}
48 ${DIFF} de.po.strip de.po.tmp || exit 1
50 LANGUAGE= ./fc4 de_DE
51 result=$?
53 rm -fr $tmpfiles
55 exit $result