No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgunfmt-tcl-1
blob66d57600eaca71779e7231ddf3a710defcc239cd
1 #! /bin/sh
3 # Test of --tcl option.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 # Test whether we can execute Tcl programs and Tcl's fconfigure command
9 # understands the -encoding option (it does since approximately Tcl 8.1).
10 tmpfiles="$tmpfiles version.tcl"
11 cat <<\EOF > version.tcl
12 fconfigure stdout -encoding utf-8
13 puts $tcl_version
14 EOF
15 (tclsh version.tcl) >/dev/null 2>/dev/null \
16 || { rm -fr $tmpfiles; exit 77; }
18 tmpfiles="$tmpfiles fr.po"
19 cat <<\EOF > fr.po
20 msgid ""
21 msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"
23 #: program.tcl:5
24 msgid "'Your command, please?', asked the waiter."
25 msgstr "«Votre commande, s'il vous plait», dit le garçon."
27 # Reverse the arguments.
28 #: program.tcl:6
29 #, tcl-format
30 msgid "%s is replaced by %s."
31 msgstr "%2$s remplace %1$s."
32 EOF
34 tmpfiles="$tmpfiles msgs"
35 test -d msgs || mkdir msgs
37 : ${MSGFMT=msgfmt}
38 ${MSGFMT} --tcl -d msgs -l fr fr.po || exit 1
40 tmpfiles="$tmpfiles prog.out"
41 : ${MSGUNFMT=msgunfmt}
42 GETTEXTDATADIR=${top_srcdir}/src \
43 ${MSGUNFMT} --tcl -d msgs -l fr -o prog.out || exit 1
45 tmpfiles="$tmpfiles prog.ok"
46 cat <<\EOF > prog.ok
47 msgid ""
48 msgstr "Content-Type: text/plain; charset=UTF-8\n"
50 msgid "'Your command, please?', asked the waiter."
51 msgstr "«Votre commande, s'il vous plait», dit le garçon."
53 msgid "%s is replaced by %s."
54 msgstr "%2$s remplace %1$s."
55 EOF
56 : ${DIFF=diff}
57 ${DIFF} prog.ok prog.out || exit 1
59 rm -fr $tmpfiles
61 exit 0