You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
1.7 KiB
92 lines
1.7 KiB
#! /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:
|