diff options
author | Bruno Haible <bruno@clisp.org> | 2003-11-25 11:05:37 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:11:21 +0200 |
commit | 569845286dbb89f52ca0c0034ea43139f57ca3d8 (patch) | |
tree | 21a571adac7fd1a41b91da7576740948a27dd743 /gettext-tools | |
parent | d2b3aff745560232199c8c4e19f9c6d4ce93b1f3 (diff) | |
download | external_gettext-569845286dbb89f52ca0c0034ea43139f57ca3d8.zip external_gettext-569845286dbb89f52ca0c0034ea43139f57ca3d8.tar.gz external_gettext-569845286dbb89f52ca0c0034ea43139f57ca3d8.tar.bz2 |
Test for extraction of tagged comments.
Diffstat (limited to 'gettext-tools')
-rwxr-xr-x | gettext-tools/tests/xgettext-awk-1 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-c-9 | 53 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-elisp-1 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-java-5 | 53 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-librep-1 | 53 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-lisp-1 | 53 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-perl-5 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-php-1 | 61 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-python-2 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-sh-2 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-smalltalk-1 | 53 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-tcl-2 | 51 | ||||
-rwxr-xr-x | gettext-tools/tests/xgettext-ycp-2 | 59 |
13 files changed, 691 insertions, 0 deletions
diff --git a/gettext-tools/tests/xgettext-awk-1 b/gettext-tools/tests/xgettext-awk-1 new file mode 100755 index 0000000..c0422b9 --- /dev/null +++ b/gettext-tools/tests/xgettext-awk-1 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test awk support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-a-1.awk" +cat <<EOF > xg-a-1.awk +# This comment will not be extracted. +print _"help" +# TRANSLATORS: This is an extracted comment. +print _"me" +# Not extracted either. +print _"Hey Jude" +# TRANSLATORS: +# Nickname of the Beatles +print _"The Fabulous Four" +EOF + +tmpfiles="$tmpfiles xg-a-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-a-1.awk -d xg-a-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-a-1.ok" +cat <<EOF > xg-a-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-a-1.ok xg-a-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-c-9 b/gettext-tools/tests/xgettext-c-9 new file mode 100755 index 0000000..b090954 --- /dev/null +++ b/gettext-tools/tests/xgettext-c-9 @@ -0,0 +1,53 @@ +#!/bin/sh + +# Test C support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-c-9.c" +cat <<EOF > xg-c-9.c +// This comment will not be extracted. +print (gettext ("help")); +// TRANSLATORS: This is an extracted comment. +print (gettext ("me")); +/* Not extracted either. */ +print (gettext ("Hey Jude")); +/* TRANSLATORS: + Nickname of the Beatles +*/ +print (gettext ("The Fabulous Four")); +EOF + +tmpfiles="$tmpfiles xg-c-9.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-c-9.c -d xg-c-9 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-c-9.ok" +cat <<EOF > xg-c-9.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-c-9.ok xg-c-9.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-elisp-1 b/gettext-tools/tests/xgettext-elisp-1 new file mode 100755 index 0000000..addbdc6 --- /dev/null +++ b/gettext-tools/tests/xgettext-elisp-1 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test EmacsLisp support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-el-1.el" +cat <<EOF > xg-el-1.el +; This comment will not be extracted. +(princ (_ "help")) +;; TRANSLATORS: This is an extracted comment. +(princ (_ "me")) +; Not extracted either. +(princ (_ "Hey Jude")) +; TRANSLATORS: +; Nickname of the Beatles +(princ (_ "The Fabulous Four")) +EOF + +tmpfiles="$tmpfiles xg-el-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-el-1.el -d xg-el-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-el-1.ok" +cat <<EOF > xg-el-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-el-1.ok xg-el-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-java-5 b/gettext-tools/tests/xgettext-java-5 new file mode 100755 index 0000000..0d77a50 --- /dev/null +++ b/gettext-tools/tests/xgettext-java-5 @@ -0,0 +1,53 @@ +#!/bin/sh + +# Test Java support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-j-5.java" +cat <<EOF > xg-j-5.java +// This comment will not be extracted. +System.out.println(gettext("help")); +// TRANSLATORS: This is an extracted comment. +System.out.println(gettext("me")); +/* Not extracted either. */ +System.out.println(gettext("Hey Jude")); +/* TRANSLATORS: + Nickname of the Beatles +*/ +System.out.println(gettext("The Fabulous Four")); +EOF + +tmpfiles="$tmpfiles xg-j-5.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-j-5.java -d xg-j-5 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-j-5.ok" +cat <<EOF > xg-j-5.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-j-5.ok xg-j-5.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-librep-1 b/gettext-tools/tests/xgettext-librep-1 new file mode 100755 index 0000000..0c92cb3 --- /dev/null +++ b/gettext-tools/tests/xgettext-librep-1 @@ -0,0 +1,53 @@ +#!/bin/sh + +# Test librep support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-lr-1.jl" +cat <<EOF > xg-lr-1.jl +; This comment will not be extracted. +(princ (_ "help")) +;; TRANSLATORS: This is an extracted comment. +(princ (_ "me")) +#| Not extracted either. |# +(princ (_ "Hey Jude")) +#| TRANSLATORS: + Nickname of the Beatles +|# +(princ (_ "The Fabulous Four")) +EOF + +tmpfiles="$tmpfiles xg-lr-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-lr-1.jl -d xg-lr-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-lr-1.ok" +cat <<EOF > xg-lr-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-lr-1.ok xg-lr-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-lisp-1 b/gettext-tools/tests/xgettext-lisp-1 new file mode 100755 index 0000000..1db3955 --- /dev/null +++ b/gettext-tools/tests/xgettext-lisp-1 @@ -0,0 +1,53 @@ +#!/bin/sh + +# Test Lisp support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-ls-1.lisp" +cat <<EOF > xg-ls-1.lisp +; This comment will not be extracted. +(write-line (gettext "help")) +;; TRANSLATORS: This is an extracted comment. +(write-line (gettext "me")) +#| Not extracted either. |# +(write-line (gettext "Hey Jude")) +#| TRANSLATORS: + Nickname of the Beatles +|# +(write-line (gettext "The Fabulous Four")) +EOF + +tmpfiles="$tmpfiles xg-ls-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-ls-1.lisp -d xg-ls-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-ls-1.ok" +cat <<EOF > xg-ls-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-ls-1.ok xg-ls-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-perl-5 b/gettext-tools/tests/xgettext-perl-5 new file mode 100755 index 0000000..de64eec --- /dev/null +++ b/gettext-tools/tests/xgettext-perl-5 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test Perl support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-pl-5.pl" +cat <<EOF > xg-pl-5.pl +# This comment will not be extracted. +print gettext "help"; +# TRANSLATORS: This is an extracted comment. +print gettext "me"; +# Not extracted either. +print gettext "Hey Jude"; +# TRANSLATORS: +# Nickname of the Beatles +print gettext "The Fabulous Four"; +EOF + +tmpfiles="$tmpfiles xg-pl-5.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-pl-5.pl -d xg-pl-5 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-pl-5.ok" +cat <<EOF > xg-pl-5.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-pl-5.ok xg-pl-5.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-php-1 b/gettext-tools/tests/xgettext-php-1 new file mode 100755 index 0000000..2ba6f5a --- /dev/null +++ b/gettext-tools/tests/xgettext-php-1 @@ -0,0 +1,61 @@ +#!/bin/sh + +# Test PHP support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-ph-1.php" +cat <<EOF > xg-ph-1.php +<? +// This comment will not be extracted. +echo _("help"); +// TRANSLATORS: This is an extracted comment. +echo _("me"); +# TRANSLATORS: This is extracted too. +echo _("and you"); +/* Not extracted either. */ +echo _("Hey Jude"); +/* TRANSLATORS: + Nickname of the Beatles +*/ +echo _("The Fabulous Four"); +?> +EOF + +tmpfiles="$tmpfiles xg-ph-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-ph-1.php -d xg-ph-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-ph-1.ok" +cat <<EOF > xg-ph-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +#. TRANSLATORS: This is extracted too. +msgid "and you" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-ph-1.ok xg-ph-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-python-2 b/gettext-tools/tests/xgettext-python-2 new file mode 100755 index 0000000..22518b7 --- /dev/null +++ b/gettext-tools/tests/xgettext-python-2 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test Python support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-py-2.py" +cat <<EOF > xg-py-2.py +# This comment will not be extracted. +print gettext.gettext("help") +# TRANSLATORS: This is an extracted comment. +print gettext.gettext("me") +# Not extracted either. +print gettext.gettext("Hey Jude") +# TRANSLATORS: +# Nickname of the Beatles +print gettext.gettext("The Fabulous Four") +EOF + +tmpfiles="$tmpfiles xg-py-2.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-py-2.py -d xg-py-2 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-py-2.ok" +cat <<EOF > xg-py-2.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-py-2.ok xg-py-2.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-sh-2 b/gettext-tools/tests/xgettext-sh-2 new file mode 100755 index 0000000..395ed83 --- /dev/null +++ b/gettext-tools/tests/xgettext-sh-2 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test Shell support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-sh-2.sh" +cat <<EOF > xg-sh-2.sh +# This comment will not be extracted. +gettext "help" +# TRANSLATORS: This is an extracted comment. +gettext "me" +# Not extracted either. +gettext "Hey Jude" +# TRANSLATORS: +# Nickname of the Beatles +gettext "The Fabulous Four" +EOF + +tmpfiles="$tmpfiles xg-sh-2.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-sh-2.sh -d xg-sh-2 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-sh-2.ok" +cat <<EOF > xg-sh-2.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-sh-2.ok xg-sh-2.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-smalltalk-1 b/gettext-tools/tests/xgettext-smalltalk-1 new file mode 100755 index 0000000..6695590 --- /dev/null +++ b/gettext-tools/tests/xgettext-smalltalk-1 @@ -0,0 +1,53 @@ +#!/bin/sh + +# Test Smalltalk support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-st-1.st" +cat <<EOF > xg-st-1.st +"This comment will not be extracted." +Transcript showCr: (NLS ? 'help'). +" TRANSLATORS: This is an extracted comment." +Transcript showCr: (NLS ? 'me'). +"Not extracted either." +Transcript showCr: (NLS ? 'Hey Jude'). +"TRANSLATORS: + Nickname of the Beatles +" +Transcript showCr: (NLS ? 'The Fabulous Four'). +EOF + +tmpfiles="$tmpfiles xg-st-1.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-st-1.st -d xg-st-1 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-st-1.ok" +cat <<EOF > xg-st-1.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-st-1.ok xg-st-1.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-tcl-2 b/gettext-tools/tests/xgettext-tcl-2 new file mode 100755 index 0000000..b572b5e --- /dev/null +++ b/gettext-tools/tests/xgettext-tcl-2 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Test Tcl support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-t-2.tcl" +cat <<EOF > xg-t-2.tcl +# This comment will not be extracted. +puts [_ "help"] +# TRANSLATORS: This is an extracted comment. +puts [_ "me"] +# Not extracted either. +puts [_ "Hey Jude"] +# TRANSLATORS: +# Nickname of the Beatles +puts [_ "The Fabulous Four"] +EOF + +tmpfiles="$tmpfiles xg-t-2.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: -k_ \ + xg-t-2.tcl -d xg-t-2 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-t-2.ok" +cat <<EOF > xg-t-2.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-t-2.ok xg-t-2.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/gettext-tools/tests/xgettext-ycp-2 b/gettext-tools/tests/xgettext-ycp-2 new file mode 100755 index 0000000..08d8112 --- /dev/null +++ b/gettext-tools/tests/xgettext-ycp-2 @@ -0,0 +1,59 @@ +#!/bin/sh + +# Test YCP support: --add-comments option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-y-2.ycp" +cat <<EOF > xg-y-2.ycp +// This comment will not be extracted. +print (_("help")); +// TRANSLATORS: This is an extracted comment. +print (_("me")); +# TRANSLATORS: This is extracted too. +print (_("and you")); +/* Not extracted either. */ +print (_("Hey Jude")); +/* TRANSLATORS: + Nickname of the Beatles +*/ +print (_("The Fabulous Four")); +EOF + +tmpfiles="$tmpfiles xg-y-2.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \ + xg-y-2.ycp -d xg-y-2 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-y-2.ok" +cat <<EOF > xg-y-2.ok +msgid "help" +msgstr "" + +#. TRANSLATORS: This is an extracted comment. +msgid "me" +msgstr "" + +#. TRANSLATORS: This is extracted too. +msgid "and you" +msgstr "" + +msgid "Hey Jude" +msgstr "" + +#. TRANSLATORS: +#. Nickname of the Beatles +#. +msgid "The Fabulous Four" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-y-2.ok xg-y-2.po +result=$? + +rm -fr $tmpfiles + +exit $result |