home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gettext-0.10.24-src.tgz
/
tar.out
/
fsf
/
gettext
/
checks
/
xgettext-8
< prev
next >
Wrap
Lisp/Scheme
|
1996-09-28
|
2KB
|
92 lines
#! /bin/sh
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles xg-test8.in.po xg-test8.c xg-test8.cc"
cat <<EOF > xg-test8.in.po
#: file1.c:199
#, fuzzy
msgid "extract me"
msgstr "some text to get fuzzy copied to result"
#: file2.cc:200
msgid "what about me"
msgstr ""
#: file3.c:10
#, c-format, fuzzy
msgid "hello"
msgstr "Again some text for fuzzy"
EOF
cat <<EOF > xg-test8.c
#include <libintl.h>
#include <stdio.h>
int
main (int argc, char *argv[])
{
printf (dcgettext ("hello", "Hello, world."));
return 0;
}
EOF
cat <<EOF > xg-test8.cc
#include <iostream.h>
#include <libintl.h>
#include <locale.h>
int
main (int argc, char *argv[])
{
cout << dcgettext ("hello", "Hello world!", LC_MESSAGES) << endl;
return 0;
}
EOF
tmpfiles="$tmpfiles xg-test8.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -n xg-test8.in.po \
xg-test8.c xg-test8.cc -d xg-test8
tmpfiles="$tmpfiles xg-test8.ok"
cat <<EOF > xg-test8.ok
#: file1.c:199
#, fuzzy
msgid "extract me"
msgstr "some text to get fuzzy copied to result"
#: file2.cc:200
msgid "what about me"
msgstr ""
#: file3.c:10
#, fuzzy, c-format
msgid "hello"
msgstr "Again some text for fuzzy"
#: xg-test8.c:6
msgid "Hello, world."
msgstr ""
#: xg-test8.cc:7
msgid "Hello world!"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-test8.ok xg-test8.po
result=$?
rm -fr $tmpfiles
exit $result
# Preserve executable bits for this shell script.
# Thanks to Noah Friedman for this great trick.
Local Variables:
Eval: (defun frobme () (set-file-modes buffer-file-name file-mode))
Eval: (make-local-variable 'file-mode)
Eval: (setq file-mode (file-modes (buffer-file-name)))
Eval: (make-local-variable 'after-save-hook)
Eval: (add-hook 'after-save-hook 'frobme)
End: