File: format-c-3

package info (click to toggle)
gettext 0.17-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 64,956 kB
  • ctags: 38,653
  • sloc: ansic: 299,024; sh: 49,429; makefile: 8,097; perl: 4,181; lisp: 3,261; yacc: 665; java: 618; cs: 578; sed: 369; objc: 337; cpp: 325; awk: 80; tcl: 63; pascal: 12; php: 8
file content (54 lines) | stat: -rwxr-xr-x 1,181 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/sh

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

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles fc3.tmp fc3.pot"
: ${XGETTEXT=xgettext}
${XGETTEXT} -o fc3.tmp --omit-header --no-location ${top_srcdir}/tests/format-c-3-prg.c
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tr -d '\r' < fc3.tmp > fc3.pot
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

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

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

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

tmpfiles="$tmpfiles de"
test -d de || mkdir de
test -d de/LC_MESSAGES || mkdir de/LC_MESSAGES

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

tmpfiles="$tmpfiles de.po.tmp de.po.un"
: ${MSGUNFMT=msgunfmt}
${MSGUNFMT} -o de.po.tmp de/LC_MESSAGES/fc3.mo
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tr -d '\r' < de.po.tmp > de.po.un
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

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

LANGUAGE= ./fc3 de_DE
result=$?

rm -fr $tmpfiles

exit $result