3 # Test of gettext facilities in the Emacs Lisp language.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles prog.el"
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"))
19 tmpfiles
="$tmpfiles prog.pot"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} -o prog.pot
--omit-header --no-location prog.el
23 tmpfiles
="$tmpfiles prog.ok"
25 msgid "'Your command, please?', asked the waiter."
29 msgid "%s is replaced by %s."
34 ${DIFF} prog.ok prog.pot ||
exit 1
36 tmpfiles
="$tmpfiles fr.po"
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.
48 msgid
"%s is replaced by %s."
49 msgstr
"%2$s remplace %1$s."
52 tmpfiles
="$tmpfiles fr.po.new"
53 : ${MSGMERGE=msgmerge}
54 ${MSGMERGE} -q -o fr.po.new fr.po prog.pot
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
64 ${MSGFMT} -o fr
/LC_MESSAGES
/prog.mo fr.po