No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / lang-elisp
blobc8a50b929b964e891c3d8bcc620fb0a98f1d030a
1 #! /bin/sh
3 # Test of gettext facilities in the Emacs Lisp language.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles prog.el"
9 cat <<\EOF > prog.el
10 (textdomain "prog")
11 (bindtextdomain "prog" ".")
13 (format standard-output "%s\n" (_ "'Your command, please?', asked the waiter."))
15 (format standard-output "%s\n"
16 (format nil (_ "%s is replaced by %s.") "FF" "EUR"))
17 EOF
19 tmpfiles="$tmpfiles prog.pot"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} -o prog.pot --omit-header --no-location prog.el
23 tmpfiles="$tmpfiles prog.ok"
24 cat <<EOF > prog.ok
25 msgid "'Your command, please?', asked the waiter."
26 msgstr ""
28 #, elisp-format
29 msgid "%s is replaced by %s."
30 msgstr ""
31 EOF
33 : ${DIFF=diff}
34 ${DIFF} prog.ok prog.pot || exit 1
36 tmpfiles="$tmpfiles fr.po"
37 cat <<\EOF > fr.po
38 msgid ""
39 msgstr ""
40 "Content-Type: text/plain; charset=ISO-8859-1\n"
41 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
43 msgid "'Your command, please?', asked the waiter."
44 msgstr "«Votre commande, s'il vous plait», dit le garçon."
46 # Reverse the arguments.
47 #, elisp-format
48 msgid "%s is replaced by %s."
49 msgstr "%2$s remplace %1$s."
50 EOF
52 tmpfiles="$tmpfiles fr.po.new"
53 : ${MSGMERGE=msgmerge}
54 ${MSGMERGE} -q -o fr.po.new fr.po prog.pot
56 : ${DIFF=diff}
57 ${DIFF} fr.po fr.po.new || exit 1
59 tmpfiles="$tmpfiles fr"
60 test -d fr || mkdir fr
61 test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
63 : ${MSGFMT=msgfmt}
64 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
66 rm -fr $tmpfiles
68 exit 0