1#! /bin/sh 2 3# Test ISO C 99 <inttypes.h> format string directives with plural forms. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8tmpfiles="$tmpfiles fc4.tmp fc4.pot" 9: ${XGETTEXT=xgettext} 10${XGETTEXT} -o fc4.tmp --omit-header --no-location ${top_srcdir}/tests/format-c-4-prg.c 11test $? = 0 || { rm -fr $tmpfiles; exit 1; } 12tr -d '\r' < fc4.tmp > fc4.pot 13test $? = 0 || { rm -fr $tmpfiles; exit 1; } 14 15tmpfiles="$tmpfiles fc4.ok" 16cat <<EOF > fc4.ok 17#, c-format 18msgid "father of %<PRId8> child" 19msgid_plural "father of %<PRId8> children" 20msgstr[0] "" 21msgstr[1] "" 22EOF 23 24: ${DIFF=diff} 25${DIFF} fc4.ok fc4.pot || exit 1 26 27tmpfiles="$tmpfiles de.po" 28cat <<EOF > de.po 29#, c-format 30msgid "father of %<PRId8> child" 31msgid_plural "father of %<PRId8> children" 32msgstr[0] "Vater eines Kindes" 33msgstr[1] "Vater von %<PRId8> Kindern" 34EOF 35 36tmpfiles="$tmpfiles de" 37test -d de || mkdir de 38test -d de/LC_MESSAGES || mkdir de/LC_MESSAGES 39 40: ${MSGFMT=msgfmt} 41${MSGFMT} -o de/LC_MESSAGES/fc4.mo de.po 42 43tmpfiles="$tmpfiles de.po.tmp de.po.un" 44: ${MSGUNFMT=msgunfmt} 45${MSGUNFMT} -o de.po.tmp de/LC_MESSAGES/fc4.mo 46test $? = 0 || { rm -fr $tmpfiles; exit 1; } 47tr -d '\r' < de.po.tmp > de.po.un 48test $? = 0 || { rm -fr $tmpfiles; exit 1; } 49 50: ${DIFF=diff} 51${DIFF} de.po de.po.un || exit 1 52 53LANGUAGE= ./fc4 de_DE 54result=$? 55 56rm -fr $tmpfiles 57 58exit $result 59