transmision: upgrade 2.22 -> 2.31
[tomato.git] / release / src / router / gettext / gettext-tools / tests / format-c-5
blob7430ac34c16123086e9fc70d68d2abfc653c76ce
1 #! /bin/sh
3 # Test 'I' format directive flag.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles fc5.pot"
9 : ${XGETTEXT=xgettext}
10 ${XGETTEXT} -o fc5.pot --omit-header --no-location ${top_srcdir}/tests/format-c-5-prg.c
12 tmpfiles="$tmpfiles fc5.ok"
13 cat <<EOF > fc5.ok
14 #, c-format
15 msgid "father of %d children"
16 msgstr ""
17 EOF
19 : ${DIFF=diff}
20 ${DIFF} fc5.ok fc5.pot || exit 1
22 tmpfiles="$tmpfiles fa.po"
23 # This should better be Farsi, not German. Can some translator help me?
24 cat <<EOF > fa.po
25 #, c-format
26 msgid "father of %d children"
27 msgstr "Vater von %Id Kindern"
28 EOF
30 tmpfiles="$tmpfiles fa"
31 test -d fa || mkdir fa
32 test -d fa/LC_MESSAGES || mkdir fa/LC_MESSAGES
34 : ${MSGFMT=msgfmt}
35 ${MSGFMT} -o fa/LC_MESSAGES/fc5.mo fa.po
37 tmpfiles="$tmpfiles fa.po.tmp"
38 : ${MSGUNFMT=msgunfmt}
39 ${MSGUNFMT} fa/LC_MESSAGES/fc5.mo -o fa.po.tmp
41 tmpfiles="$tmpfiles fa.po.strip"
42 sed 1d < fa.po > fa.po.strip
44 : ${DIFF=diff}
45 ${DIFF} fa.po.strip fa.po.tmp || exit 1
47 LANGUAGE= ./fc5 fa_IR
48 case $? in
49 0) ;;
50 77) rm -fr $tmpfiles; exit 77;;
51 *) exit 1;;
52 esac
54 rm -fr $tmpfiles
56 exit 0