diff options
author | Robin Houston <robin@lenny.robin> | 2011-06-09 12:54:05 +0100 |
---|---|---|
committer | Robin Houston <robin@lenny.robin> | 2011-06-09 12:54:05 +0100 |
commit | 4d077dc48fb0589dbf401a131d524b23ab0d2258 (patch) | |
tree | 680b12febc448827ee937039d38e97020b4c5df9 /vendor/gems/gettext-2.1.0/test | |
parent | cb67f4d0ef9feae96a90ea5bba63c939268b1224 (diff) |
Bundle the locale and gettext gems
Diffstat (limited to 'vendor/gems/gettext-2.1.0/test')
84 files changed, 2574 insertions, 0 deletions
diff --git a/vendor/gems/gettext-2.1.0/test/README b/vendor/gems/gettext-2.1.0/test/README new file mode 100644 index 000000000..f159b66e4 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/README @@ -0,0 +1 @@ +Go to gettext dir and run "rake makemo" prior to running any tests!
\ No newline at end of file diff --git a/vendor/gems/gettext-2.1.0/test/Rakefile b/vendor/gems/gettext-2.1.0/test/Rakefile new file mode 100644 index 000000000..1d1e0247f --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/Rakefile @@ -0,0 +1,17 @@ +$LOAD_PATH.unshift "../lib" + +task :default => :test + +desc "Create mo files" +task :makemo do + require 'gettext/tools' + GetText.create_mofiles(:mo_root => "locale") +end + +desc 'Run all tests' +task :test do + Dir.glob("**/test_*.rb").each do |path| + puts "" + ruby "-I../lib:../../locale/lib -rubygems #{path}" + end +end diff --git a/vendor/gems/gettext-2.1.0/test/locale/cr/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/cr/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..b6c1fcd53 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/cr/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..1604a69b7 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural_error.mo b/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural_error.mo Binary files differnew file mode 100644 index 000000000..a33f51fd9 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/da/LC_MESSAGES/plural_error.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..b814f5ff3 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural_error.mo b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural_error.mo Binary files differnew file mode 100644 index 000000000..e774b09c3 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/plural_error.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test1.mo b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test1.mo Binary files differnew file mode 100644 index 000000000..5ffa9f95e --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test1.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test2.mo b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test2.mo Binary files differnew file mode 100644 index 000000000..97183f297 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/fr/LC_MESSAGES/test2.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ir/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/ir/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..160c1e725 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ir/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/npgettext.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/npgettext.mo Binary files differnew file mode 100644 index 000000000..dcb616842 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/npgettext.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/nsgettext.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/nsgettext.mo Binary files differnew file mode 100644 index 000000000..073301527 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/nsgettext.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/pgettext.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/pgettext.mo Binary files differnew file mode 100644 index 000000000..b0eeb41d8 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/pgettext.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..0748463c3 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural_error.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural_error.mo Binary files differnew file mode 100644 index 000000000..9a6600554 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/plural_error.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/rubyparser.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/rubyparser.mo Binary files differnew file mode 100644 index 000000000..d204fe1f1 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/rubyparser.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/sgettext.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/sgettext.mo Binary files differnew file mode 100644 index 000000000..38a885037 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/sgettext.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test1.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test1.mo Binary files differnew file mode 100644 index 000000000..46fd44a6e --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test1.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test2.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test2.mo Binary files differnew file mode 100644 index 000000000..adc89b1ee --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test2.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test3.mo b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test3.mo Binary files differnew file mode 100644 index 000000000..9ed02c744 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/ja/LC_MESSAGES/test3.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..5f71e52db --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural_error.mo b/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural_error.mo Binary files differnew file mode 100644 index 000000000..14b875ca2 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/la/LC_MESSAGES/plural_error.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..5b9e23c99 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural_error.mo b/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural_error.mo Binary files differnew file mode 100644 index 000000000..5a9dc5f5d --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/li/LC_MESSAGES/plural_error.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/po/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/po/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..0f1677a0a --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/po/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/locale/sl/LC_MESSAGES/plural.mo b/vendor/gems/gettext-2.1.0/test/locale/sl/LC_MESSAGES/plural.mo Binary files differnew file mode 100644 index 000000000..f92254b5f --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/locale/sl/LC_MESSAGES/plural.mo diff --git a/vendor/gems/gettext-2.1.0/test/po/cr/plural.po b/vendor/gems/gettext-2.1.0/test/po/cr/plural.po new file mode 100644 index 000000000..92f4a7d1d --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/cr/plural.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=3; plural= n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "cr_one" +msgstr[1] "cr_two" +msgstr[2] "cr_three" diff --git a/vendor/gems/gettext-2.1.0/test/po/da/plural.po b/vendor/gems/gettext-2.1.0/test/po/da/plural.po new file mode 100644 index 000000000..c6ff529d8 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/da/plural.po @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=2; plural= n != 1;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "da_one" +msgstr[1] "da_plural" diff --git a/vendor/gems/gettext-2.1.0/test/po/da/plural_error.po b/vendor/gems/gettext-2.1.0/test/po/da/plural_error.po new file mode 100644 index 000000000..1ca81140e --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/da/plural_error.po @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: hello_plural.rb:11 +msgid "first" +msgid_plural "second" +msgstr[0] "da_first" +msgstr[1] "da_second" diff --git a/vendor/gems/gettext-2.1.0/test/po/fr/plural.po b/vendor/gems/gettext-2.1.0/test/po/fr/plural.po new file mode 100644 index 000000000..9f3b6dd18 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/fr/plural.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "fr_one" +msgstr[1] "fr_plural" + +#: hello_plural.rb:14 +msgid "single" +msgid_plural "plural" +msgstr[0] "fr_hitotsu" +msgstr[1] "fr_fukusu" diff --git a/vendor/gems/gettext-2.1.0/test/po/fr/plural_error.po b/vendor/gems/gettext-2.1.0/test/po/fr/plural_error.po new file mode 100644 index 000000000..9d9025b5c --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/fr/plural_error.po @@ -0,0 +1,20 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: hello_plural.rb:11 +msgid "first" +msgid_plural "second" +msgstr[0] "fr_first" diff --git a/vendor/gems/gettext-2.1.0/test/po/fr/test1.po b/vendor/gems/gettext-2.1.0/test/po/fr/test1.po new file mode 100644 index 000000000..841503432 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/fr/test1.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-01-01 02:24:56+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: simple.rb:10 +msgid "language" +msgstr "french" + +#: simple.rb:14 +msgid "one is %d." +msgstr "FRENCH:ONE IS %d." diff --git a/vendor/gems/gettext-2.1.0/test/po/fr/test2.po b/vendor/gems/gettext-2.1.0/test/po/fr/test2.po new file mode 100644 index 000000000..c0bb028d0 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/fr/test2.po @@ -0,0 +1,19 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2001-10-28 01:39:53+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: test.rb:9 test.rb:11 +msgid "LANGUAGE" +msgstr "FRENCH" diff --git a/vendor/gems/gettext-2.1.0/test/po/ir/plural.po b/vendor/gems/gettext-2.1.0/test/po/ir/plural.po new file mode 100644 index 000000000..97d3ba4f4 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ir/plural.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "ir_one" +msgstr[1] "ir_two" +msgstr[2] "ir_plural" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/npgettext.po b/vendor/gems/gettext-2.1.0/test/po/ja/npgettext.po new file mode 100644 index 000000000..aa2eb2b2b --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/npgettext.po @@ -0,0 +1,46 @@ +# Japanese translations for PACKAGE package +# PACKAGE パッケージに対する英訳. +# Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Masao Mutoh <mutomasa at gmail.com>, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2008-08-06 02:36+0900\n" +"PO-Revision-Date: 2008-08-06 02:36+0900\n" +"Last-Translator: Masao Mutoh <mutomasa at gmail.com>\n" +"Language-Team: Japanese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: testlib/npgettext.rb:10 testlib/npgettext.rb:11 testlib/npgettext.rb:15 +#: testlib/npgettext.rb:16 +msgctxt "Magazine" +msgid "a book" +msgid_plural "%{num} books" +msgstr[0] "一つの本" +msgstr[1] "%{num}の本たち" + +#: testlib/npgettext.rb:20 testlib/npgettext.rb:21 +msgctxt "Hardcover" +msgid "a book" +msgid_plural "%{num} books" +msgstr[0] "一つのハードカバー本" +msgstr[1] "%{num}のハードカバー本たち" + +#: testlib/npgettext.rb:25 testlib/npgettext.rb:26 +msgctxt "Magaine" +msgid "I have a magazine" +msgid_plural "I have %{num} magazines" +msgstr[0] "マガジンを1冊持ってます。" +msgstr[0] "マガジンたちを%{num}冊持ってます。" + +#: testlib/npgettext.rb:30 testlib/npgettext.rb:31 +msgctxt "Hardcover" +msgid "a picture" +msgid_plural "%{num} pictures" +msgstr[0] "" +msgstr[1] "" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/nsgettext.po b/vendor/gems/gettext-2.1.0/test/po/ja/nsgettext.po new file mode 100644 index 000000000..9d5c13e74 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/nsgettext.po @@ -0,0 +1,65 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2007-07-03 00:20+0900\n" +"PO-Revision-Date: 2007-07-03 00:20+0900\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: nsgettext.rb:10 nsgettext.rb:14 +msgid "AAA|BBB" +msgid_plural "CCC" +msgstr[0] "single" +msgstr[1] "plural" + +#: nsgettext.rb:18 +msgid "AAA" +msgid_plural "BBB" +msgstr[0] "" +msgstr[1] "" + +#: nsgettext.rb:22 +msgid "AAA|CCC" +msgid_plural "DDD" +msgstr[0] "" +msgstr[1] "" + +#: nsgettext.rb:26 +msgid "AAA|BBB|CCC" +msgid_plural "DDD" +msgstr[0] "" +msgstr[1] "" + +#: nsgettext.rb:30 +msgid "AAA$BBB" +msgid_plural "CCC" +msgstr[0] "" +msgstr[1] "" + +#: nsgettext.rb:34 +msgid "AAA$B|BB" +msgid_plural "CCC" +msgstr[0] "" +msgstr[1] "" + +#: nsgettext.rb:38 +msgid "AAA$B|CC" +msgid_plural "DDD" +msgstr[0] "single" +msgstr[1] "plural" + +#: nsgettext.rb:42 +msgid "AAA|CCC|BBB" +msgid_plural "DDD" +msgstr[0] "" +msgstr[1] "" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/pgettext.po b/vendor/gems/gettext-2.1.0/test/po/ja/pgettext.po new file mode 100644 index 000000000..d4005f8da --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/pgettext.po @@ -0,0 +1,41 @@ +# Japanese translations for PACKAGE package +# PACKAGE パッケージに対する英訳. +# Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Masao Mutoh <mutomasa at gmail.com>, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2008-07-26 15:39+0900\n" +"PO-Revision-Date: 2008-07-26 15:39+0900\n" +"Last-Translator: Masao Mutoh <mutomasa at gmail.com>\n" +"Language-Team: Japanese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: testlib/pgettext.rb:10 testlib/pgettext.rb:14 +msgctxt "AAA" +msgid "BBB" +msgstr "えーびー" + +#: testlib/pgettext.rb:18 +msgctxt "AAA|BBB" +msgid "CCC" +msgstr "えーびーしー" + +#: testlib/pgettext.rb:22 +msgctxt "AAA" +msgid "CCC" +msgstr "" + +#: testlib/pgettext.rb:26 +msgctxt "CCC" +msgid "BBB" +msgstr "しーびー" + +#: testlib/pgettext.rb:33 +msgid "BBB" +msgstr "びー" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/plural.po b/vendor/gems/gettext-2.1.0/test/po/ja/plural.po new file mode 100644 index 000000000..fb45fef02 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/plural.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "all" +msgstr[1] "" + +#: hello_plural.rb:13 +msgid "single" +msgid_plural "plural" +msgstr[0] "hitotsu" +msgstr[1] "fukusu" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/plural_error.po b/vendor/gems/gettext-2.1.0/test/po/ja/plural_error.po new file mode 100644 index 000000000..6991f243e --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/plural_error.po @@ -0,0 +1,20 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: hello_plural.rb:11 +msgid "first" +msgid_plural "second" +msgstr[0] "a" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/rubyparser.po b/vendor/gems/gettext-2.1.0/test/po/ja/rubyparser.po new file mode 100644 index 000000000..554952ef5 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/rubyparser.po @@ -0,0 +1,43 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2004-07-03 23:03+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: test_rubyparser.rb:8 +msgid "aaa" +msgstr "AAA" + +#: test_rubyparser.rb:12 +msgid "aaa\n" +msgstr "AAA\n" + +#: test_rubyparser.rb:16 +msgid "bbb\nccc" +msgstr "BBB\nCCC" + +#: test_rubyparser.rb:20 +msgid "bbb\nccc\nddd\n" +msgstr "BBB\nCCC\nDDD\n" + +#: test_rubyparser.rb:27 test_rubyparser.rb:31 +msgid "eee" +msgstr "EEE" + +#: test_rubyparser.rb:31 +msgid "fff" +msgstr "FFF" + +#: test_rubyparser.rb:35 +msgid "ggghhhiii" +msgstr "GGGHHHIII" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/sgettext.po b/vendor/gems/gettext-2.1.0/test/po/ja/sgettext.po new file mode 100644 index 000000000..ee2869e9a --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/sgettext.po @@ -0,0 +1,47 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2004-08-12 03:31+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: sgettext.rb:10 sgettext.rb:14 +msgid "AAA|BBB" +msgstr "MATCHED" + +#: sgettext.rb:18 +msgid "AAA" +msgstr "" + +#: sgettext.rb:22 +msgid "AAA|CCC" +msgstr "" + +#: sgettext.rb:26 +msgid "AAA|BBB|CCC" +msgstr "" + +#: sgettext.rb:30 +msgid "AAA$BBB" +msgstr "" + +#: sgettext.rb:34 +msgid "AAA$B|BB" +msgstr "" + +#: sgettext.rb:38 +msgid "AAA$B|CC" +msgstr "MATCHED" + +#: sgettext.rb:42 +msgid "AAA|CCC|BBB" +msgstr "" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/test1.po b/vendor/gems/gettext-2.1.0/test/po/ja/test1.po new file mode 100644 index 000000000..19993fb1f --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/test1.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-01-01 02:24:56+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: simple.rb:10 +msgid "language" +msgstr "japanese" + +#: simple.rb:14 +msgid "one is %d." +msgstr "ONE IS %d." diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/test2.po b/vendor/gems/gettext-2.1.0/test/po/ja/test2.po new file mode 100644 index 000000000..1f4801e20 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/test2.po @@ -0,0 +1,19 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2001-10-28 01:39:53+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: test.rb:9 test.rb:11 +msgid "LANGUAGE" +msgstr "JAPANESE" diff --git a/vendor/gems/gettext-2.1.0/test/po/ja/test3.po b/vendor/gems/gettext-2.1.0/test/po/ja/test3.po new file mode 100644 index 000000000..675ca0583 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/ja/test3.po @@ -0,0 +1,19 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2001-10-28 01:39:53+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: ENCODING\n" + +#: test.rb:9 test.rb:11 +msgid "language" +msgstr "JAPANESE" diff --git a/vendor/gems/gettext-2.1.0/test/po/la/plural.po b/vendor/gems/gettext-2.1.0/test/po/la/plural.po new file mode 100644 index 000000000..55ce771f8 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/la/plural.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n!=0 ? 1 : 2 ;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "la_one" +msgstr[1] "la_plural" +msgstr[2] "la_zero" diff --git a/vendor/gems/gettext-2.1.0/test/po/la/plural_error.po b/vendor/gems/gettext-2.1.0/test/po/la/plural_error.po new file mode 100644 index 000000000..a9cacf022 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/la/plural_error.po @@ -0,0 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=2; plural= n != 1;\n" + +#: hello_plural.rb:11 +msgid "first" +msgid_plural "second" +msgstr[0] "la_first" diff --git a/vendor/gems/gettext-2.1.0/test/po/li/plural.po b/vendor/gems/gettext-2.1.0/test/po/li/plural.po new file mode 100644 index 000000000..784308e22 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/li/plural.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=3; plural= n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "li_one" +msgstr[1] "li_two" +msgstr[2] "li_three" diff --git a/vendor/gems/gettext-2.1.0/test/po/li/plural_error.po b/vendor/gems/gettext-2.1.0/test/po/li/plural_error.po new file mode 100644 index 000000000..a44afc496 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/li/plural_error.po @@ -0,0 +1,27 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=0; plural=EXPRESSION;\n" + +#: hello_plural.rb:11 +msgid "first" +msgid_plural "second" +msgstr[0] "li_first" + +#: hello_plural.rb:13 +msgid "one" +msgid_plural "two" +msgstr[0] "li_one" +msgstr[1] "li_two" diff --git a/vendor/gems/gettext-2.1.0/test/po/po/plural.po b/vendor/gems/gettext-2.1.0/test/po/po/plural.po new file mode 100644 index 000000000..7f26ba78c --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/po/plural.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "po_one" +msgstr[1] "po_two" +msgstr[2] "po_three" diff --git a/vendor/gems/gettext-2.1.0/test/po/sl/plural.po b/vendor/gems/gettext-2.1.0/test/po/sl/plural.po new file mode 100644 index 000000000..479faaba2 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/po/sl/plural.po @@ -0,0 +1,24 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR ORGANIZATION +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-10-21 15:32:15+0900\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=US-ASCII\n" +"Content-Transfer-Encoding: ENCODING\n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n" + +#: hello_plural.rb:11 +msgid "one" +msgid_plural "two" +msgstr[0] "sl_one" +msgstr[1] "sl_two" +msgstr[2] "sl_three" +msgstr[3] "sl_four" diff --git a/vendor/gems/gettext-2.1.0/test/test_class_info.rb b/vendor/gems/gettext-2.1.0/test/test_class_info.rb new file mode 100644 index 000000000..bb74bac2d --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_class_info.rb @@ -0,0 +1,83 @@ +require 'testlib/helper.rb' +require 'gettext/runtime/class_info' + +module M1; end +module M2; end + +module M1 + module M3 + include M2 + module M4; end + class C1; end + end + class C2 + module M5 + class C4; end + end + class C3; end + end +end + +module M1::M6 + include M1::M3::M4 + module M7; end +end + +module M8 + module M9 + end + include M9 +end + +# Anonymous module +@@anon = Module.new +class @@anon::AC1; end +module @@anon::AM1; end + +class TestClassInfo < Test::Unit::TestCase + include GetText::ClassInfo + + def test_normalize_class + assert_equal M1::M3, normalize_class(M1::M3) + assert_equal M1::M3::C1, normalize_class(M1::M3::C1) + assert_equal M1::M3::C1, normalize_class(M1::M3::C1.new) + + assert_equal NilClass, normalize_class(nil) + assert_equal TestClassInfo, normalize_class(self) + end + + def test_normalize_class_anonymous_module + assert_equal Object, normalize_class(@@anon) + assert_equal Object, normalize_class(@@anon) + assert_equal Object, normalize_class(@@anon::AC1) + assert_equal Object, normalize_class(@@anon::AM1) + end + + def test_related_classes +=begin + assert_equal [M1, Object], related_classes(M1) + assert_equal [M1::M3, M1, M2, Object], related_classes(M1::M3) + assert_equal [M1::M3::M4, M1::M3, M1, M2, Object], related_classes(M1::M3::M4) +=end + assert_equal [M1::M3::C1, M1::M3, M1, M2, Object], related_classes(M1::M3::C1) +=begin + assert_equal [M1::C2, M1, Object], related_classes(M1::C2) + assert_equal [M1::C2::M5::C4, M1::C2::M5, M1::C2, M1, Object], related_classes(M1::C2::M5::C4) + assert_equal [M1::C2::C3, M1::C2, M1, Object], related_classes(M1::C2::C3) + assert_equal [M1::M6, M1, M1::M3::M4, M1::M3, M2, Object], related_classes(M1::M6) + assert_equal [M1::M6::M7, M1::M6, M1, M1::M3::M4, M1::M3, M2, Object], related_classes(M1::M6::M7) +=end + end + + def test_rellated_classes_with_all_classes + assert_equal [M1, Object], related_classes(M1, [M1]) + assert_equal [M1, Object], related_classes(M1::M3::M4, [M1]) + assert_equal [M1::M3, Object], related_classes(M1::M3::M4, [M1::M3]) + assert_equal [M1::M3, M1, Object], related_classes(M1::M3::M4, [M1::M3, M1]) + end + + def test_related_classes_loop_mixin + assert_equal [M8, M8::M9, Object], related_classes(M8) + end + +end diff --git a/vendor/gems/gettext-2.1.0/test/test_gettext.rb b/vendor/gems/gettext-2.1.0/test/test_gettext.rb new file mode 100644 index 000000000..f4e2ea51b --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_gettext.rb @@ -0,0 +1,311 @@ +# -*- coding: utf-8 -*- +require 'testlib/helper.rb' + +require 'testlib/simple.rb' +require 'testlib/gettext.rb' +require 'testlib/sgettext.rb' +require 'testlib/nsgettext.rb' +require 'testlib/pgettext.rb' +require 'testlib/npgettext.rb' + +class TestGetText < Test::Unit::TestCase + + def setup + ENV["LC_ALL"] = "ja_JP.UTF-8" + ENV["LANG"] = "ja_JP.UTF-8" + GetText.locale = nil + GetText::TextDomainManager.clear_caches + end + + def test_change_locale + GetText.locale = nil + bindtextdomain("test2", "locale") + test = Simple.new + assert_equal("japanese", test.test) + set_locale("fr") + assert_equal("french", test.test) # influence of previous line + assert_equal("FRENCH:ONE IS 1.", test.test_formatted_string) + set_locale("ja") + assert_equal("JAPANESE", _("LANGUAGE")) # influence of previous line + assert_equal("japanese", test.test) + end + + def test_no_msgstr + bindtextdomain("test1", :path => "locale") + assert_equal("nomsgstr", _("nomsgstr")) + end + + def test_empty + bindtextdomain("test1", "locale") + assert_equal("japanese", gettext("language")) + assert_equal("", gettext("")) + assert_equal("", gettext(nil)) + end + + def test_gettext + test = TestRubyParser.new + assert_equal("AAA", test.test_1) + assert_equal("AAA\n", test.test_2) + assert_equal("BBB\nCCC", test.test_3) + assert_equal("BBB +CCC +DDD +", test.test_4) + assert_equal("EEE", test.test_5) + assert_equal("EEEfooFFF", test.test_6) + assert_equal("GGGHHHIII", test.test_7) + end + + def test_N_ + assert_equal("test", N_("test")) + end + + def test_sgettext + test = TestSGetText.new + + assert_equal("MATCHED", test.test_1) + assert_equal("MATCHED", test.test_2) + assert_equal("AAA", test.test_3) + assert_equal("CCC", test.test_4) + assert_equal("CCC", test.test_5) + assert_equal("BBB", test.test_6) + assert_equal("B|BB", test.test_7) + assert_equal("MATCHED", test.test_8) + assert_equal("BBB", test.test_9) + end + + def test_s_uses_no_seperator_when_nil_is_given + assert_equal "AAA|BBB", s_("AAA|BBB", nil) + end + + def test_pgettext + GetText.locale = nil + test = TestPGetText.new + + assert_equal("えーびー", test.test_1) + assert_equal("えーびー", test.test_2) + assert_equal("えーびーしー", test.test_3) + assert_equal("CCC", test.test_4) + assert_equal("しーびー", test.test_5) + assert_equal("びー", test.test_6) + + GetText.locale = "en" + test = TestPGetText.new + + assert_equal("BBB", test.test_1) + assert_equal("BBB", test.test_2) + assert_equal("CCC", test.test_3) + assert_equal("CCC", test.test_4) + assert_equal("BBB", test.test_5) + assert_equal("BBB", test.test_6) + end + + def test_npgettext + GetText.locale = nil + test = TestNPGetText.new + assert_equal(["一つの本", "%{num}の本たち"], test.test_1) + assert_equal(["一つの本", "%{num}の本たち"], test.test_2) + assert_equal(["一つのハードカバー本", "%{num}のハードカバー本たち"], test.test_3) + assert_equal(["マガジンを1冊持ってます。", "マガジンたちを%{num}冊持ってます。"], test.test_4) + assert_equal(["a picture", "%{num} pictures"], test.test_5) + end + + def test_n_defaults_to_1_when_number_is_missing + assert_equal n_("aaa","aaa2",1), "aaa" + end + + def test_nsgettext + GetText.locale = nil + test = TestNSGetText.new + assert_equal(["single", "plural"], test.test_1) + assert_equal(["single", "plural"], test.test_2) + assert_equal(["AAA", "BBB"], test.test_3) + assert_equal(["CCC", "DDD"], test.test_4) + assert_equal(["CCC", "DDD"], test.test_5) + assert_equal(["BBB", "CCC"], test.test_6) + assert_equal(["B|BB", "CCC"], test.test_7) + assert_equal(["single", "plural"], test.test_8) + assert_equal(["BBB", "DDD"], test.test_9) + end + + def test_plural + GetText.locale = nil + bindtextdomain("plural", :path => "locale") + assert_equal("all", n_("one", "two", 0)) + assert_equal("all", n_("one", "two", 1)) + assert_equal("all", n_("one", "two", 2)) + + set_locale("da") + assert_equal("da_plural", n_("one", "two", 0)) + assert_equal("da_one", n_("one", "two", 1)) + assert_equal("da_plural", n_("one", "two", 2)) + + set_locale("fr") + assert_equal("fr_one", ngettext("one", "two", 0)) + assert_equal("fr_one", ngettext("one", "two", 1)) + assert_equal("fr_plural", ngettext("one", "two", 2)) + + set_locale("la") + assert_equal("la_one", ngettext("one", "two", 21)) + assert_equal("la_one", ngettext("one", "two", 1)) + assert_equal("la_plural", ngettext("one", "two", 2)) + assert_equal("la_zero", ngettext("one", "two", 0)) + + set_locale("ir") + assert_equal("ir_one", ngettext("one", "two", 1)) + assert_equal("ir_two", ngettext("one", "two", 2)) + assert_equal("ir_plural", ngettext("one", "two", 3)) + assert_equal("ir_plural", ngettext("one", "two", 0)) + + set_locale("li") + assert_equal("li_one", ngettext("one", "two", 1)) + assert_equal("li_two", ngettext("one", "two", 22)) + assert_equal("li_three", ngettext("one", "two", 11)) + + set_locale("cr") + assert_equal("cr_one", ngettext("one", "two", 1)) + assert_equal("cr_two", ngettext("one", "two", 2)) + assert_equal("cr_three", ngettext("one", "two", 5)) + + set_locale("po") + assert_equal("po_one", ngettext("one", "two", 1)) + assert_equal("po_two", ngettext("one", "two", 2)) + assert_equal("po_three", ngettext("one", "two", 5)) + + set_locale("sl") + assert_equal("sl_one", ngettext("one", "two", 1)) + assert_equal("sl_two", ngettext("one", "two", 2)) + assert_equal("sl_three", ngettext("one", "two", 3)) + assert_equal("sl_three", ngettext("one", "two", 4)) + assert_equal("sl_four", ngettext("one", "two", 5)) + end + + def test_plural_format_invalid + bindtextdomain("plural_error", :path => "locale") + #If it defines msgstr[0] only, msgstr[0] is used everytime. + assert_equal("a", n_("first", "second", 0)) + assert_equal("a", n_("first", "second", 1)) + assert_equal("a", n_("first", "second", 2)) + # Use default(plural = 0) + set_locale("fr") + assert_equal("fr_first", n_("first", "second", 0)) + assert_equal("fr_first", n_("first", "second", 1)) + assert_equal("fr_first", n_("first", "second", 2)) + setlocale("da") # Invalid Plural-Forms. + assert_equal("da_first", n_("first", "second", 0)) + assert_equal("da_first", n_("first", "second", 1)) + assert_equal("da_first", n_("first", "second", 2)) + setlocale("la") # wrong number of msgstr. + assert_equal("la_first", n_("first", "second", 0)) + assert_equal("la_first", n_("first", "second", 1)) + assert_equal("la_first", n_("first", "second", 2)) + + setlocale("li") # Invalid Plural-Forms: nplurals is set, but wrong plural=. + assert_equal("li_first", n_("first", "second", 0)) + assert_equal("li_first", n_("first", "second", 1)) + assert_equal("li_first", n_("first", "second", 2)) + assert_equal("li_one", n_("one", "two", 0)) + assert_equal("li_one", n_("one", "two", 1)) + assert_equal("li_one", n_("one", "two", 2)) + end + + def test_plural_array + bindtextdomain("plural", :path => "locale") + set_locale "da" + assert_equal("da_plural", n_(["one", "two"], 0)) + assert_equal("da_one", n_(["one", "two"], 1)) + assert_equal("da_plural", n_(["one", "two"], 2)) + end + + def test_plural_with_single + bindtextdomain("plural", :path => "locale") + + assert_equal("hitotsu", _("single")) + assert_equal("hitotsu", n_("single", "plural", 1)) + assert_equal("hitotsu", n_("single", "plural", 2)) + assert_equal("all", n_("one", "two", 1)) + assert_equal("all", n_("one", "two", 2)) + assert_equal("all", _("one")) + + bindtextdomain("plural", :path => "locale") + set_locale "fr" + + assert_equal("fr_hitotsu", _("single")) + assert_equal("fr_hitotsu", n_("single", "plural", 1)) + assert_equal("fr_fukusu", n_("single", "plural", 2)) + assert_equal("fr_one", n_("one", "two", 1)) + assert_equal("fr_plural", n_("one", "two", 2)) + assert_equal("fr_one", _("one")) + +# assert_equal("fr_hitotsu", n_("single", "not match", 1)) +# assert_equal("fr_fukusu", n_("single", "not match", 2)) + end + + def test_Nn_ + GetText.locale = "da" + bindtextdomain("plural", :path => "locale") + assert_equal(["one", "two"], Nn_("one", "two")) + end + + def test_setlocale + bindtextdomain("test1", :path => "locale") + assert_equal("japanese", _("language")) + set_locale("en") + assert_equal("language", _("language")) + + set_locale("fr") + assert_equal("french", _("language")) + + set_locale(nil) + Locale.set "en" + assert_equal("language", _("language")) + + Locale.set "ja" + assert_equal("japanese", _("language")) + + # Confirm to set Locale::Object. + loc = Locale::Tag::Posix.parse("ja_JP.UTF-8") + assert_equal(loc, GetText.locale = loc) + assert_equal(Locale::Tag::Posix, GetText.locale.class) + end + + def test_restrict_locale + bindtextdomain("test1", :path => "locale") + Locale.set_app_language_tags("ja", "en") + + Locale.set_current "fr" + assert_equal("language", _("language")) + + Locale.set_current "en" + assert_equal("language", _("language")) + + Locale.set_current "ja" + assert_equal("japanese", _("language")) + Locale.set_app_language_tags(nil) + end + + + # Anonymous + @@anon = Module.new + class @@anon::I + bindtextdomain("test1", :path => "locale") + def self.test + _("language") + end + def test2 + _("language") + end + end + + def test_anonymous_module + assert_equal("japanese", @@anon::I.test) + assert_equal("japanese", @@anon::I.new.test2) + + end + + def test_frozen + GetText.bindtextdomain("test1", :path => "locale") + assert(GetText._("language").frozen?) + end + +end diff --git a/vendor/gems/gettext-2.1.0/test/test_locale_path.rb b/vendor/gems/gettext-2.1.0/test/test_locale_path.rb new file mode 100644 index 000000000..31d94f047 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_locale_path.rb @@ -0,0 +1,50 @@ +require 'testlib/helper.rb' +require 'testlib/simple' + +class TestLocalePath < Test::Unit::TestCase + def setup + GetText.locale = "ja_JP.eucJP" + GetText::LocalePath.clear + end + + def test_locale_path + test = Simple.new + assert_equal("japanese", test.test) + prefix = GetText::LocalePath::CONFIG_PREFIX + default_locale_dirs = [ + "./locale/%{lang}/LC_MESSAGES/%{name}.mo", + "./locale/%{lang}/%{name}.mo", + "#{Config::CONFIG['datadir']}/locale/%{lang}/LC_MESSAGES/%{name}.mo", + "#{Config::CONFIG['datadir'].gsub(/\/local/, "")}/locale/%{lang}/LC_MESSAGES/%{name}.mo", + "#{prefix}/share/locale/%{lang}/LC_MESSAGES/%{name}.mo", + "#{prefix}/local/share/locale/%{lang}/LC_MESSAGES/%{name}.mo" + ].uniq + assert_equal(default_locale_dirs, GetText::LocalePath::DEFAULT_RULES) + new_path = "/foo/%{lang}/%{name}.mo" + GetText::LocalePath.add_default_rule(new_path) + assert_equal([new_path] + default_locale_dirs, GetText::LocalePath::DEFAULT_RULES) + end + + def test_initialize_with_topdir + testdir = File.dirname(File.expand_path(__FILE__)) + path = GetText::LocalePath.new("test1", "#{testdir}/locale") + assert_equal path.locale_paths, { "ja" => "#{testdir}/locale/ja/LC_MESSAGES/test1.mo", + "fr" => "#{testdir}/locale/fr/LC_MESSAGES/test1.mo"} + assert_equal path.current_path(Locale::Tag.parse("ja")), "#{testdir}/locale/ja/LC_MESSAGES/test1.mo" + assert_equal path.current_path(Locale::Tag.parse("ja-JP")), "#{testdir}/locale/ja/LC_MESSAGES/test1.mo" + assert_equal path.current_path(Locale::Tag.parse("ja_JP.UTF-8")), "#{testdir}/locale/ja/LC_MESSAGES/test1.mo" + assert_equal path.current_path(Locale::Tag.parse("en")), nil + end + + def test_supported_locales + testdir = File.dirname(File.expand_path(__FILE__)) + path = GetText::LocalePath.new("test1", "#{testdir}/locale") + assert_equal ["fr", "ja"], path.supported_locales + + path = GetText::LocalePath.new("plural", "#{testdir}/locale") + assert_equal ["cr", "da", "fr", "ir", "ja", "la", "li", "po", "sl"], path.supported_locales + + path = GetText::LocalePath.new("nodomain", "#{testdir}/locale") + assert_equal [], path.supported_locales + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_parser.rb b/vendor/gems/gettext-2.1.0/test/test_parser.rb new file mode 100644 index 000000000..bbbe51fbe --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_parser.rb @@ -0,0 +1,158 @@ +require 'testlib/helper.rb' +require 'gettext/tools/parser/ruby' +require 'gettext/tools/parser/glade' +require 'gettext/tools/parser/erb' + +require 'gettext/tools/rgettext' + +class TestGetTextParser < Test::Unit::TestCase + def test_ruby + @ary = GetText::RGetText.parse('testlib/gettext.rb') + + assert_target 'aaa', ['testlib/gettext.rb:8'] + assert_target 'aaa\n', ['testlib/gettext.rb:12'] + assert_target 'bbb\nccc', ['testlib/gettext.rb:16'] + assert_target 'bbb\nccc\nddd\n', ['testlib/gettext.rb:20'] + assert_target 'eee', ['testlib/gettext.rb:27', 'testlib/gettext.rb:31'] + assert_target 'fff', ['testlib/gettext.rb:31'] + assert_target 'ggghhhiii', ['testlib/gettext.rb:35'] + assert_target 'a"b"c"', ['testlib/gettext.rb:41'] + assert_target 'd"e"f"', ['testlib/gettext.rb:45'] + assert_target 'jjj', ['testlib/gettext.rb:49'] + assert_target 'kkk', ['testlib/gettext.rb:50'] + assert_target 'lllmmm', ['testlib/gettext.rb:54'] + assert_target 'nnn\nooo', ['testlib/gettext.rb:62'] + assert_target "\#", ['testlib/gettext.rb:66', 'testlib/gettext.rb:70'] + assert_target "\\taaa", ['testlib/gettext.rb:74'] + assert_target "Here document1\\nHere document2\\n", ['testlib/gettext.rb:78'] + assert_target "Francois Pinard", ['testlib/gettext.rb:97'] do |t| + assert_match /proper name/, t.comment + assert_match /Pronunciation/, t.comment + end + assert_target "self explaining", ['testlib/gettext.rb:102'] do |t| + assert_nil t.comment + end + # TODO: assert_target "in_quote", ['testlib/gettext.rb:96'] + end + + def test_ruby_N + @ary = GetText::RGetText.parse('testlib/N_.rb') + + assert_target 'aaa', ['testlib/N_.rb:8'] + assert_target 'aaa\n', ['testlib/N_.rb:12'] + assert_target 'bbb\nccc', ['testlib/N_.rb:16'] + assert_target 'bbb\nccc\nddd\n', ['testlib/N_.rb:20'] + assert_target 'eee', ['testlib/N_.rb:27', 'testlib/N_.rb:31'] + assert_target 'fff', ['testlib/N_.rb:31'] + assert_target 'ggghhhiii', ['testlib/N_.rb:35'] + assert_target 'a"b"c"', ['testlib/N_.rb:41'] + assert_target 'd"e"f"', ['testlib/N_.rb:45'] + assert_target 'jjj', ['testlib/N_.rb:49'] + assert_target 'kkk', ['testlib/N_.rb:50'] + assert_target 'lllmmm', ['testlib/N_.rb:54'] + assert_target 'nnn\nooo', ['testlib/N_.rb:62'] + end + + def test_ruby_n + @ary = GetText::RGetText.parse('testlib/ngettext.rb') + assert_plural_target "aaa", "aaa2", ['testlib/ngettext.rb:8'] + assert_plural_target "bbb\\n", "ccc2\\nccc2", ['testlib/ngettext.rb:12'] + assert_plural_target "ddd\\nddd", "ddd2\\nddd2", ['testlib/ngettext.rb:16'] + assert_plural_target "eee\\neee\\n", "eee2\\neee2\\n", ['testlib/ngettext.rb:21'] + assert_plural_target "ddd\\neee\\n", "ddd\\neee2", ['testlib/ngettext.rb:27'] + assert_plural_target "fff", "fff2", ['testlib/ngettext.rb:34', 'testlib/ngettext.rb:38'] + assert_plural_target "ggg", "ggg2", ['testlib/ngettext.rb:38'] + assert_plural_target "ggghhhiii", "jjjkkklll", ['testlib/ngettext.rb:42'] + assert_plural_target "a\"b\"c\"", "a\"b\"c\"2", ['testlib/ngettext.rb:51'] + assert_plural_target "mmmmmm", "mmm2mmm2", ['testlib/ngettext.rb:59'] + assert_plural_target "nnn", "nnn2", ['testlib/ngettext.rb:60'] + assert_plural_target "comment", "comments", ['testlib/ngettext.rb:76'] do |t| + assert_equal "please provide translations for all \n the plural forms!", t.comment + end + end + + def test_ruby_p + @ary = GetText::RGetText.parse('testlib/pgettext.rb') + assert_target_in_context "AAA", "BBB", ["testlib/pgettext.rb:8", "testlib/pgettext.rb:12"] + assert_target_in_context "AAA|BBB", "CCC", ["testlib/pgettext.rb:16"] + assert_target_in_context "AAA", "CCC", ["testlib/pgettext.rb:20"] + assert_target_in_context "CCC", "BBB", ["testlib/pgettext.rb:24"] + assert_target_in_context "program", "name", ['testlib/pgettext.rb:34'] do |t| + assert_equal "please translate 'name' in the context of 'program'.\n Hint: the translation should NOT contain the translation of 'program'.", t.comment + end + end + + def test_glade + # Old style (~2.0.4) + ary = GetText::GladeParser.parse('testlib/gladeparser.glade') + + assert_equal(['window1', 'testlib/gladeparser.glade:8'], ary[0]) + assert_equal(['normal text', 'testlib/gladeparser.glade:29'], ary[1]) + assert_equal(['1st line\n2nd line\n3rd line', 'testlib/gladeparser.glade:50'], ary[2]) + assert_equal(['<span color="red" weight="bold" size="large">markup </span>', 'testlib/gladeparser.glade:73'], ary[3]) + assert_equal(['<span color="red">1st line markup </span>\n<span color="blue">2nd line markup</span>', 'testlib/gladeparser.glade:94'], ary[4]) + assert_equal(['<span>"markup" with <escaped strings></span>', 'testlib/gladeparser.glade:116'], ary[5]) + assert_equal(['duplicated', 'testlib/gladeparser.glade:137', 'testlib/gladeparser.glade:158'], ary[6]) + end + + def testlib_erb + @ary = GetText::ErbParser.parse('testlib/erb.rhtml') + + assert_target 'aaa', ['testlib/erb.rhtml:8'] + assert_target 'aaa\n', ['testlib/erb.rhtml:11'] + assert_target 'bbb', ['testlib/erb.rhtml:12'] + assert_plural_target "ccc1", "ccc2", ['testlib/erb.rhtml:13'] + end + + def test_rgettext_parse + GetText::ErbParser.init(:extnames => ['.rhtml', '.rxml']) + @ary = GetText::RGetText.parse(['testlib/erb.rhtml']) + assert_target 'aaa', ['testlib/erb.rhtml:8'] + assert_target 'aaa\n', ['testlib/erb.rhtml:11'] + assert_target 'bbb', ['testlib/erb.rhtml:12'] + assert_plural_target "ccc1", "ccc2", ['testlib/erb.rhtml:13'] + + @ary = GetText::RGetText.parse(['testlib/erb.rxml']) + assert_target 'aaa', ['testlib/erb.rxml:9'] + assert_target 'aaa\n', ['testlib/erb.rxml:12'] + assert_target 'bbb', ['testlib/erb.rxml:13'] + assert_plural_target "ccc1", "ccc2", ['testlib/erb.rxml:14'] + + @ary = GetText::RGetText.parse(['testlib/ngettext.rb']) + assert_plural_target "ooo", "ppp", ['testlib/ngettext.rb:64', 'testlib/ngettext.rb:65'] + assert_plural_target "qqq", "rrr", ['testlib/ngettext.rb:69', 'testlib/ngettext.rb:70'] + end + + private + + def assert_target(msgid, sources = nil) + t = @ary.detect {|elem| elem.msgid == msgid} + if t + if sources + assert_equal sources.sort, t.sources.sort, 'Translation target sources do not match.' + end + yield t if block_given? + else + flunk "Expected a translation target with id '#{msgid}'. Not found." + end + end + + def assert_plural_target(msgid, plural, sources = nil) + assert_target msgid, sources do |t| + assert_equal plural, t.msgid_plural, 'Expected plural form' + yield t if block_given? + end + end + + def assert_target_in_context(msgctxt, msgid, sources = nil) + t = @ary.detect {|elem| elem.msgid == msgid && elem.msgctxt == msgctxt} + if t + if sources + assert_equal sources.sort, t.sources.sort, 'Translation target sources do not match.' + end + yield t if block_given? + else + flunk "Expected a translation target with id '#{msgid}' and context '#{msgctxt}'. Not found." + end + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_po_generation.rb b/vendor/gems/gettext-2.1.0/test/test_po_generation.rb new file mode 100644 index 000000000..dea071b1b --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_po_generation.rb @@ -0,0 +1,20 @@ +require 'testlib/helper.rb' +require 'gettext' +require 'gettext/tools/rgettext.rb' +require 'stringio' + +class TestPoGeneration < Test::Unit::TestCase + def test_extracted_comments + GetText::RGetText.run( + File.join(File.dirname(__FILE__), 'testlib/gettext.rb'), + out = StringIO.new) + res = out.string + + # Use following to debug the content of the + # created file: File.open('/tmp/test.po', 'w').write(res) + + assert_match '#. "Fran\u00e7ois" or (with HTML entities) "François".', res + assert_no_match /Ignored/, res, 'Only comments starting with TRANSLATORS should be extracted' + assert_no_match /TRANSLATORS: This is a proper name/, res, 'The prefix "TRANSLATORS:" should be skipped' + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_pomessage.rb b/vendor/gems/gettext-2.1.0/test/test_pomessage.rb new file mode 100644 index 000000000..51b7d053d --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_pomessage.rb @@ -0,0 +1,99 @@ +require 'testlib/helper.rb' +require 'gettext/tools/parser/ruby' + +# Most functionality of PoMessage is thoroughly tested together +# with the parser and po file generator. Here only tests for some special +# functionality. +class TestPoMessage < Test::Unit::TestCase + + def test_context_match + tt1 = GetText::PoMessage.new(:msgctxt) + tt1.msgid = 'hello' + tt1.msgctxt = 'world' + tt2 = GetText::PoMessage.new(:normal) + tt2.msgid = 'hello' + assert_raise GetText::ParseError do + tt1.merge tt2 + end + end + + def test_attribute_accumulation + tt = GetText::PoMessage.new(:plural) + tt.set_current_attribute 'long' + tt.set_current_attribute ' tail' + tt.advance_to_next_attribute + tt.set_current_attribute 'long tails' + assert_equal 'long tail', tt.msgid + assert_equal 'long tails', tt.msgid_plural + end + + def test_to_po_str_normal + po = GetText::PoMessage.new(:normal) + po.msgid = 'hello' + po.sources = ["file1:1", "file2:10"] + assert_equal "\n#: file1:1 file2:10\nmsgid \"hello\"\nmsgstr \"\"\n", po.to_po_str + + po.msgctxt = 'context' + po.msgid_plural = 'hello2' + # Ignore these properties. + assert_equal "\n#: file1:1 file2:10\nmsgid \"hello\"\nmsgstr \"\"\n", po.to_po_str + end + + def test_to_po_str_plural + po = GetText::PoMessage.new(:plural) + po.msgid = 'hello' + po.msgid_plural = 'hello2' + po.sources = ["file1:1", "file2:10"] + assert_equal "\n#: file1:1 file2:10\nmsgid \"hello\"\nmsgid_plural \"hello2\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n", po.to_po_str + + po.msgctxt = 'context' + # Ignore this property + assert_equal "\n#: file1:1 file2:10\nmsgid \"hello\"\nmsgid_plural \"hello2\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n", po.to_po_str + end + + def test_to_po_str_msgctxt + po = GetText::PoMessage.new(:msgctxt) + po.msgctxt = 'context' + po.msgid = 'hello' + po.sources = ["file1:1", "file2:10"] + assert_equal "\n#: file1:1 file2:10\nmsgctxt \"context\"\nmsgid \"hello\"\nmsgstr \"\"\n", po.to_po_str + end + + def test_to_po_str_msgctxt_plural + po = GetText::PoMessage.new(:msgctxt_plural) + po.msgctxt = 'context' + po.msgid = 'hello' + po.msgid_plural = 'hello2' + po.sources = ["file1:1", "file2:10"] + assert_equal "\n#: file1:1 file2:10\nmsgctxt \"context\"\nmsgid \"hello\"\nmsgid_plural \"hello2\"\nmsgstr[0] \"\"\nmsgstr[1] \"\"\n", po.to_po_str + end + + def test_to_po_str_exception + po = GetText::PoMessage.new(:normal) + po.sources = ["file1:1", "file2:10"] + assert_raise(RuntimeError){ po.to_po_str } + + po.sources = nil + assert_raise(RuntimeError){ po.to_po_str } + + po = GetText::PoMessage.new(:plural) + po.msgid = 'hello' + po.sources = ["file1:1", "file2:10"] + assert_raise(RuntimeError){ po.to_po_str } + + po.msgid_plural = 'hello2' + po.sources = nil + assert_raise(RuntimeError){ po.to_po_str } + + po = GetText::PoMessage.new(:msgctxt) + po.msgid = 'hello' + po.sources = ["file1:1", "file2:10"] + assert_raise(RuntimeError){ po.to_po_str } + + po = GetText::PoMessage.new(:msgctxt_plural) + po.msgctxt = 'context' + po.msgid = 'hello' + po.sources = ["file1:1", "file2:10"] + assert_raise(RuntimeError){ po.to_po_str } + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_string.rb b/vendor/gems/gettext-2.1.0/test/test_string.rb new file mode 100644 index 000000000..43460e134 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_string.rb @@ -0,0 +1,65 @@ +require 'testlib/helper.rb' + +class TestGetTextString < Test::Unit::TestCase + def test_sprintf + assert_equal("foo is a number", "%{msg} is a number" % {:msg => "foo"}) + assert_equal("bar is a number", "%s is a number" % ["bar"]) + assert_equal("bar is a number", "%s is a number" % "bar") + assert_equal("1, test", "%{num}, %{record}" % {:num => 1, :record => "test"}) + assert_equal("test, 1", "%{record}, %{num}" % {:num => 1, :record => "test"}) + assert_equal("1, test", "%d, %s" % [1, "test"]) + assert_equal("test, 1", "%2$s, %1$d" % [1, "test"]) + assert_raise(ArgumentError) { "%-%" % [1] } + end + + def test_sprintf_placeholder_include_non_english + assert_equal("a", "%{foo+foo}" % {"foo+foo".to_sym => "a"}) + assert_equal("a", "%{foo.foo}" % {"foo.foo".to_sym => "a"}) + assert_equal("a }", "%{foo+foo} }" % {"foo+foo".to_sym => "a"}) + assert_equal("a { b }", "%{foo+foo} { %{bar bar-} }" % {"foo+foo".to_sym => "a", "bar bar-".to_sym => "b"}) + end + + def test_percent + assert_equal("% 1", "%% %<num>d" % {:num => 1.0}) + assert_equal("%{num} %<num>d", "%%{num} %%<num>d" % {:num => 1}) + end + + def test_sprintf_percent_in_replacement + assert_equal("%<not_translated>s", "%{msg}" % { :msg => '%<not_translated>s', :not_translated => 'should not happen' }) + end + + def test_sprintf_lack_argument + assert_equal("%{num}, test", "%{num}, %{record}" % {:record => "test"}) + assert_equal("%{record}", "%{record}" % {:num => 1}) + end + + def test_no_placeholder + assert_equal("aaa", "aaa" % {:num => 1}) + assert_equal("bbb", "bbb" % [1]) + end + + def test_sprintf_ruby19_style + assert_equal("1", "%<num>d" % {:num => 1}) + assert_equal("0b1", "%<num>#b" % {:num => 1}) + assert_equal("foo", "%<msg>s" % {:msg => "foo"}) + assert_equal("1.000000", "%<num>f" % {:num => 1.0}) + assert_equal(" 1", "%<num>3.0f" % {:num => 1.0}) + assert_equal("100.00", "%<num>2.2f" % {:num => 100.0}) + assert_equal("0x64", "%<num>#x" % {:num => 100.0}) + assert_equal("a", "%<foo.foo>s" % {"foo.foo".to_sym => "a"}) + assert_raise(ArgumentError) { "%<num>,d" % {:num => 100} } + assert_raise(ArgumentError) { "%<num>/d" % {:num => 100} } + end + + def test_sprintf_old_style + assert_equal("foo 1.000000", "%s %f" % ["foo", 1.0]) + end + + def test_sprintf_mix + assert_equal("foo 1.000000", "%{name} %<num>f" % {:name => "foo", :num => 1.0}) + assert_equal("%{name} 1.000000", "%{name} %f" % [1.0]) + assert_equal("%{name} 1.000000", "%{name} %f" % [1.0, 2.0]) + end + + +end diff --git a/vendor/gems/gettext-2.1.0/test/test_textdomain_bind.rb b/vendor/gems/gettext-2.1.0/test/test_textdomain_bind.rb new file mode 100644 index 000000000..d44d831c1 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_textdomain_bind.rb @@ -0,0 +1,37 @@ +require 'testlib/helper.rb' + +class Foo +end + +class TestGetTextBind < Test::Unit::TestCase + def setup + GetText.locale = "ja_JP.EUC-JP" + GetText::TextDomainManager.clear_all_textdomains + end + + def test_bindtextdomain + domain = GetText.bindtextdomain("foo") + assert_equal domain, GetText::TextDomainManager.create_or_find_textdomain_group(Object).textdomains[0] + assert_equal domain, GetText::TextDomainManager.textdomain_pool("foo") + end + + def test_textdomain + domain1 = GetText.bindtextdomain("foo") + + assert_equal domain1, GetText.textdomain("foo") + + assert_raise(GetText::NoboundTextDomainError) { + GetText.textdomain_to(Foo, "bar") + } + end + + def test_textdomain_to + domain1 = GetText.bindtextdomain("foo") + + assert_equal domain1, GetText.textdomain_to(Foo, "foo") + + assert_raise(GetText::NoboundTextDomainError) { + GetText.textdomain_to(Foo, "bar") + } + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_textdomain_multi.rb b/vendor/gems/gettext-2.1.0/test/test_textdomain_multi.rb new file mode 100644 index 000000000..2278e7e22 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_textdomain_multi.rb @@ -0,0 +1,80 @@ +require 'testlib/helper.rb' +require 'testlib/multi_textdomain.rb' + +class TestGetTextMulti < Test::Unit::TestCase + + def setup + GetText.locale = "ja" + end + + def test_two_domains_in_a_class + + test = C11.new + assert_equal("japanese", test.test) # Use test1.po + assert_equal("JAPANESE", test.test2) # Use test2.po + + test = C12.new + assert_equal("japanese", test.test) # Use test1.po + assert_equal("JAPANESE", test.test2) # Use test2.po + end + + def test_inheritance + # inheritance. only parent has a textdomain and it's methods + test = C21.new + assert_equal("japanese", test.test) # Use C11's po(test1.po) + assert_equal("JAPANESE", test.test2) # Use C11's po(test2.po) + + test = C22.new + assert_equal("japanese", test.test) # Use C11's po(test1.po) + assert_equal("JAPANESE", test.test2) # Use C11's po(test2.po) + end + + def test_module_and_sub_modules + # module + assert_equal("japanese", M1.test) + + # sub-module. only an included module has a textdomain and it's methods + assert_equal("japanese", M1::M1M1.test) # Same method with M1. + assert_equal("LANGUAGE", M1::M1M1.test2) # No influence from ancestors. + + # sub-class (class bindtextdomain). + test = M1::M1C1.new + assert_equal("japanese", test.test) # Use test1.po + assert_equal("JAPANESE", test.test2) # Use test2.po + + # sub-class (instance bindtextdomain). + test = M1::M1C2.new + assert_equal("japanese", test.test) # Use test1.po + assert_equal("JAPANESE", test.test2) # Use test2.po + end + + def test_eval + test = C2.new + assert_equal("japanese", test.test) # Use test1.po + end + + def test_as_class_methods + test = C3.new + assert_equal("japanese", test.test) # Use test1.po + assert_equal("japanese", C3.test) # Use test1.po + end + + def test_simple_inheritance + test = C4.new + assert_equal("japanese", test.test) # Use C3's test1.po + assert_equal("japanese", C4.test) # Use C3's test1.po + assert_equal("JAPANESE", test.test2) # Use C4's test2.po + assert_equal("no data", test.test3) # No po file. + end + + def test_same_msgid_but_different_textdomain + test1 = C12.new # test1 domain + test2 = C51.new # test3 domain + test3 = C52.new # test3 domain but inherited C11. + + assert_equal("japanese", test1.test) # Use text1 message + assert_equal("JAPANESE", test2.test) # Use text3 message + assert_equal("JAPANESE", test3.test) # Use text3 message + end + +end diff --git a/vendor/gems/gettext-2.1.0/test/test_textdomain_toplevel.rb b/vendor/gems/gettext-2.1.0/test/test_textdomain_toplevel.rb new file mode 100644 index 000000000..0e737bfa3 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_textdomain_toplevel.rb @@ -0,0 +1,42 @@ +require 'testlib/helper.rb' +include GetText + +bindtextdomain("test1", :path => "locale") +module M1 + module_function + def module_function + _("language") + end +end + +class C1 + def instance_method + _("language") + end + def self.class_method + _("language") + end +end + +def toplevel_method + _("language") +end + +class TestGetText < Test::Unit::TestCase + include GetText + + def test_toplevel + GetText.locale = "ja" + assert_equal("japanese", toplevel_method) + assert_equal("japanese", M1.module_function) + assert_equal("japanese", C1.class_method) + assert_equal("japanese", C1.new.instance_method) + + GetText::TextDomainManager.clear_all_textdomains + GetText.bindtextdomain("test1", :path => "locale") + assert_equal("japanese", toplevel_method) + assert_equal("japanese", M1.module_function) + assert_equal("japanese", C1.class_method) + assert_equal("japanese", C1.new.instance_method) + end +end diff --git a/vendor/gems/gettext-2.1.0/test/test_thread.rb b/vendor/gems/gettext-2.1.0/test/test_thread.rb new file mode 100644 index 000000000..5fa8be84f --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/test_thread.rb @@ -0,0 +1,41 @@ +require 'testlib/helper.rb' +require 'thread' + +class TestThread < Test::Unit::TestCase + include GetText + + bindtextdomain "test1", :path => "locale" + + def setup + Locale.init(:driver => :env) + @mutex = Mutex.new + end + + def invoke_thread(tag, language, sleep_time) + Thread.start do + @mutex.synchronize { + Thread.current["language"] = language + GetText.current_locale = tag + } + (1..10).each do |v| + @mutex.synchronize{ + assert_equal Thread.current["language"], _("language") + } + print "." + $stdout.flush + sleep sleep_time + end + end + end + + def test_thread + th1 = invoke_thread("ja_JP.eucJP", "japanese", 0.4) + th2 = invoke_thread("fr", "french", 0.3) + th3 = invoke_thread("en", "language", 0.1) + th4 = invoke_thread("zh_CN", "language", 0.2) # No translation. + th1.join + th2.join + th3.join + th4.join + end +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/N_.rb b/vendor/gems/gettext-2.1.0/test/testlib/N_.rb new file mode 100644 index 000000000..f69b6ede2 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/N_.rb @@ -0,0 +1,66 @@ +require 'gettext' +include GetText + +class TestRubyParser_N + bindtextdomain("testN_rubyparser", :path => "locale") + + def testN_1 + N_("aaa") + end + + def testN_2 + N_("aaa\n") + end + + def testN_3 + N_("bbb\nccc") + end + + def testN_4 + N_("bbb +ccc +ddd +") + end + + def testN_5 + N_("eee") + end + + def testN_6 + N_("eee") + "foo" + N_("fff") + end + + def testN_7 + N_("ggg"\ + "hhh"\ + "iii") + end + + def testN_8 + N_('a"b"c"') + end + + def testN_9 + N_("d\"e\"f\"") + end + + def testN_10 + N_("jjj") + + N_("kkk") + end + + def testN_11 + N_("lll" + "mmm") + end + + def testN_12 + puts N_(msg), "ppp" #Ignored + end + + def testN_13 + N_("nnn\n" + + "ooo") + end +end + diff --git a/vendor/gems/gettext-2.1.0/test/testlib/erb.rhtml b/vendor/gems/gettext-2.1.0/test/testlib/erb.rhtml new file mode 100644 index 000000000..d19c75cf2 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/erb.rhtml @@ -0,0 +1,15 @@ +<% + require 'gettext' + include GetText + bindtextdomain("helloerb", :path => "locale") +%> +<html> +<head> +<title><%= _("aaa") %></title> +</head> +<body> +<h1><%= _("aaa\n") %></h1> +<p><%= N_("bbb") %></p> +<p><%= n_("ccc1", "ccc2", 1) %></p> +</body> +</html> diff --git a/vendor/gems/gettext-2.1.0/test/testlib/erb.rxml b/vendor/gems/gettext-2.1.0/test/testlib/erb.rxml new file mode 100644 index 000000000..cb0f1a269 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/erb.rxml @@ -0,0 +1,16 @@ +<?xml version="1.0" standalone="no"?> +<% + require 'gettext' + include GetText + bindtextdomain("helloerb", :path => "locale") +%> +<html> +<head> +<title><%= _("aaa") %></title> +</head> +<body> +<h1><%= _("aaa\n") %></h1> +<p><%= N_("bbb") %></p> +<p><%= n_("ccc1", "ccc2", 1) %></p> +</body> +</html> diff --git a/vendor/gems/gettext-2.1.0/test/testlib/gettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/gettext.rb new file mode 100644 index 000000000..0324e9424 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/gettext.rb @@ -0,0 +1,113 @@ +require 'gettext' +include GetText + +class TestRubyParser + bindtextdomain("rubyparser", :path => "locale") + + def test_1 + _("aaa") + end + + def test_2 + _("aaa\n") + end + + def test_3 + _("bbb\nccc") + end + + def test_4 + _("bbb +ccc +ddd +") + end + + def test_5 + _("eee") + end + + def test_6 + _("eee") + "foo" + _("fff") + end + + def test_7 + _("ggg"\ + "hhh"\ + "iii") + end + + def test_8 + _('a"b"c"') + end + + def test_9 + _("d\"e\"f\"") + end + + def test_10 + _("jjj") + + _("kkk") + end + + def test_11 + _("lll" + "mmm") + end + + def test_12 + puts _(msg), "ppp" #Ignored + end + + def test_13 + _("nnn\n" + + "ooo") + end + def test_14 + _("\#") + end + + def test_15 + _('#') + end + + def test_16 + _('\taaa') + end + + def test_17 + ret = _(<<EOF +Here document1 +Here document2 +EOF +) + end + + def test_18 + "<div>#{_('in_quote')}</div>" + end + + def about + puts ( + # TRANSLATORS: This is a proper name. See the gettext + # manual, section Names. Note this is actually a non-ASCII + # name: The first name is (with Unicode escapes) + # "Fran\u00e7ois" or (with HTML entities) "François". + # Pronunciation is like "fraa-swa pee-nar". + # This is an example from GNU gettext documentation. + _("Francois Pinard")) + + puts ( + # This comment should not be extracted because it does + # not start with 'TRANSLATORS:' + _('self explaining')) + end + +end + +module ActionController + class Base + end +end +class ApplicationController < ActionController::Base + "#{Time.now.strftime('%m/%d')}" +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/gladeparser.glade b/vendor/gems/gettext-2.1.0/test/testlib/gladeparser.glade new file mode 100644 index 000000000..0e278cc61 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/gladeparser.glade @@ -0,0 +1,183 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">window1</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes">normal text</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">1st line +2nd line +3rd line</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes"><span color="red" weight="bold" size="large">markup </span></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes"><span color="red">1st line markup </span> +<span color="blue">2nd line markup</span></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes"><span>&quot;markup&quot; with &lt;escaped strings&gt;</span></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes">duplicated</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="label" translatable="yes">duplicated</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <placeholder/> + </child> + </widget> + </child> +</widget> + +</glade-interface> diff --git a/vendor/gems/gettext-2.1.0/test/testlib/helper.rb b/vendor/gems/gettext-2.1.0/test/testlib/helper.rb new file mode 100644 index 000000000..17754901c --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/helper.rb @@ -0,0 +1,11 @@ +$LOAD_PATH.unshift File.expand_path("../../lib", File.dirname(__FILE__)) +require 'test/unit' + +require 'rubygems' +require 'gettext' + +#optional gems +begin + require 'redgreen' +rescue LoadError +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/multi_textdomain.rb b/vendor/gems/gettext-2.1.0/test/testlib/multi_textdomain.rb new file mode 100644 index 000000000..dd9070b01 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/multi_textdomain.rb @@ -0,0 +1,131 @@ +class C11 + include GetText + def initialize + bindtextdomain("test1", :path => "locale") + bindtextdomain("test2", :path => "locale") + end + def test + _("language") + end + def test2 + _("LANGUAGE") + end +end + +class C12 + include GetText + bindtextdomain("test1", :path => "locale") + bindtextdomain("test2", :path => "locale") + + def test + _("language") + end + def test2 + _("LANGUAGE") + end +end + +class C21 < C11 +end + +class C22 < C12 +end + +module M1 + include GetText + bindtextdomain("test1", :path => "locale") + + module_function + def test + _("language") + end + + module M1M1 + include GetText + module_function + def test + _("language") + end + # Doesn't translate + def test2 + _("LANGUAGE") + end + end + + class M1C1 + include GetText + bindtextdomain("test2", :path => "locale") + def test + _("language") + end + def test2 + _("LANGUAGE") + end + end + + class M1C2 + include GetText + def initialize + bindtextdomain("test2", :path => "locale") + end + def test + _("language") + end + def test2 + _("LANGUAGE") + end + end + +end + +class C2 + include GetText + def initialize + bindtextdomain("test1", :path => "locale") + end + + def test + _("language") + end + + def test_eval + eval("_(\"language\")") + end +end + +class C3 + include GetText + bindtextdomain("test1", :path => "locale") + + def test + _("language") + end + + def self.test + _("language") + end +end + +class C4 < C3 + bindtextdomain("test2", :path => "locale") + + def test2 + _("LANGUAGE") + end + + def test3 + _("no data") + end +end + +class C51 + include GetText + bindtextdomain("test3", :path => "locale") + def test + _("language") + end +end + +class C52 < C12 + bindtextdomain("test3", :path => "locale") +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/ngettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/ngettext.rb new file mode 100644 index 000000000..d28eda695 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/ngettext.rb @@ -0,0 +1,79 @@ +require 'gettext' +include GetText + +class TestRubyParser_n + bindtextdomain("rubyparser", :path => "locale") + + def test_1 + n_("aaa","aaa2",1) + end + + def test_2 + n_("bbb\n", "ccc2\nccc2", 1) + end + + def test_3_1 + n_("ddd\nddd", + "ddd2\nddd2", + 1) + end + def test_3_2 + n_("eee\neee\n" , + "eee2\neee2\n" , + 1) + end + + def test_4 + n_("ddd +eee +", "ddd +eee2", 1) + end + + def test_5_1 + n_("fff", "fff2", 1) + end + + def test_5_2 + n_("fff", "fff2", 1) + "foo" + n_("ggg", "ggg2", 1) + end + + def test_6 + n_("ggg"\ + "hhh"\ + "iii", + "jjj"\ + "kkk"\ + "lll", 1) + end + + def test_7 + n_('a"b"c"', 'a"b"c"2', 1) + end + + def test_8 + n_("d\"e\"f\"", "d\"e\"f\"2", 1) + end + + def test_9 + n_("mmm" + "mmm","mmm2" + "mmm2",1) + + n_("nnn" ,"nnn2" ,1) + end + + def test_10 + _("ooo") + n_("ooo", "ppp", 1) + end + + def test_11 + n_("qqq", "rrr", 1) + n_("qqq", "sss", 1) # This is merged to "qqq" with plural form "rrr". + end + + def extracted_comments + # TRANSLATORS:please provide translations for all + # the plural forms! + n_('comment', 'comments', 2) + end +end + diff --git a/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb new file mode 100644 index 000000000..b92c6cda7 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/npgettext.rb @@ -0,0 +1,31 @@ +require 'gettext' + +class TestNPGetText + include GetText + bindtextdomain("npgettext", :path => "locale") + + def test_1 + [np_("Magazine", "a book", "%{num} books", 1), + np_("Magazine", "a book", "%{num} books", 2)] + end + + def test_2 + [npgettext("Magazine", "a book", "%{num} books", 1), + npgettext("Magazine", "a book", "%{num} books", 2)] + end + + def test_3 + [np_("Hardcover", "a book", "%{num} books", 1), + np_("Hardcover", "a book", "%{num} books", 2)] + end + + def test_4 + [np_("Magaine", "I have a magazine", "I have %{num} magazines", 1), + np_("Magaine", "I have a magazine", "I have %{num} magazines", 2)] + end + + def test_5 + [np_("Hardcover", "a picture", "%{num} pictures", 1), + np_("Hardcover", "a picture", "%{num} pictures", 2)] #not found. + end +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/nsgettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/nsgettext.rb new file mode 100644 index 000000000..67ef25be5 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/nsgettext.rb @@ -0,0 +1,42 @@ +require 'gettext' + +class TestNSGetText + include GetText + bindtextdomain("nsgettext", :path => "locale") + + def test_1 + [ns_("AAA|BBB", "CCC", 1), ns_("AAA|BBB", "CCC", 2)] + end + + def test_2 + [nsgettext("AAA|BBB", "CCC", 1), nsgettext("AAA|BBB", "CCC", 2)] + end + + def test_3 + [ns_("AAA", "BBB", 1), ns_("AAA", "BBB", 2)] #not found + end + + def test_4 + [ns_("AAA|CCC", "DDD", 1), ns_("AAA|CCC", "DDD", 2)] #not found + end + + def test_5 + [ns_("AAA|BBB|CCC", "DDD", 1), ns_("AAA|BBB|CCC", "DDD", 2)] #not found + end + + def test_6 + [ns_("AAA$BBB", "CCC", 1, "$"), ns_("AAA$BBB", "CCC", 2, "$")] #not found + end + + def test_7 + [ns_("AAA$B|BB", "CCC", 1, "$"), ns_("AAA$B|BB", "CCC", 2, "$")] #not found + end + + def test_8 + [ns_("AAA$B|CC", "DDD", 1, "$"), ns_("AAA$B|CC", "DDD", 2, "$")] + end + + def test_9 + [ns_("AAA|CCC|BBB", "DDD", 1), ns_("AAA|CCC|BBB", "DDD", 2)] #not found + end +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/pgettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/pgettext.rb new file mode 100644 index 000000000..2d4c6fd60 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/pgettext.rb @@ -0,0 +1,36 @@ +require 'gettext' + +class TestPGetText + include GetText + bindtextdomain("pgettext", :path => "locale") + + def test_1 + p_("AAA", "BBB") + end + + def test_2 + pgettext("AAA", "BBB") + end + + def test_3 + pgettext("AAA|BBB", "CCC") + end + + def test_4 + p_("AAA", "CCC") #not found + end + + def test_5 + p_("CCC", "BBB") + end + + def test_6 # not pgettext. + _("BBB") + end + + def with_context + # TRANSLATORS:please translate 'name' in the context of 'program'. + # Hint: the translation should NOT contain the translation of 'program'. + p_('program', 'name') + end +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/sgettext.rb b/vendor/gems/gettext-2.1.0/test/testlib/sgettext.rb new file mode 100644 index 000000000..050e266bf --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/sgettext.rb @@ -0,0 +1,46 @@ +require 'gettext' + +class TestSGetText + include GetText + bindtextdomain("sgettext", :path => "locale") + + def test_1 + s_("AAA|BBB") + end + + def test_2 + sgettext("AAA|BBB") + end + + def test_3 + s_("AAA") #not found + end + + def test_4 + s_("AAA|CCC") #not found + end + + def test_5 + s_("AAA|BBB|CCC") #not found + end + + def test_6 + s_("AAA$BBB", "$") #not found + end + + def test_7 + s_("AAA$B|BB", "$") #not found + end + + def test_8 + s_("AAA$B|CC", "$") + end + + def test_9 + s_("AAA|CCC|BBB") #not found + end + + def setlocale(locale) + __setlocale(locale) + end +end diff --git a/vendor/gems/gettext-2.1.0/test/testlib/simple.rb b/vendor/gems/gettext-2.1.0/test/testlib/simple.rb new file mode 100644 index 000000000..64339894a --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/testlib/simple.rb @@ -0,0 +1,14 @@ +require 'gettext' + +class Simple + include GetText + bindtextdomain("test1", :path => "locale") + + def test + _("language") + end + + def test_formatted_string + _("one is %d.") % 1 + end +end diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/app.pot b/vendor/gems/gettext-2.1.0/test/tools/files/app.pot new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/app.pot diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/de/app.po b/vendor/gems/gettext-2.1.0/test/tools/files/de/app.po new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/de/app.po diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/en/app.po b/vendor/gems/gettext-2.1.0/test/tools/files/en/app.po new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/en/app.po diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/en/test.po b/vendor/gems/gettext-2.1.0/test/tools/files/en/test.po new file mode 100644 index 000000000..2226dc919 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/en/test.po @@ -0,0 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: x\n" +"POT-Creation-Date: 2009-02-15 09:23+0100\n" +"PO-Revision-Date: 2009-02-15 09:23+0100\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: tools/files/simple_translation.rb:1 +msgid "a translation" +msgstr "" diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/simple_1.po b/vendor/gems/gettext-2.1.0/test/tools/files/simple_1.po new file mode 100644 index 000000000..89993dcfa --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/simple_1.po @@ -0,0 +1,2 @@ +msgid "x" +msgstr "y"
\ No newline at end of file diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/simple_2.po b/vendor/gems/gettext-2.1.0/test/tools/files/simple_2.po new file mode 100644 index 000000000..c404c0ced --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/simple_2.po @@ -0,0 +1,2 @@ +msgid "a" +msgstr "b"
\ No newline at end of file diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/simple_translation.rb b/vendor/gems/gettext-2.1.0/test/tools/files/simple_translation.rb new file mode 100644 index 000000000..16e182a01 --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/simple_translation.rb @@ -0,0 +1 @@ +_('a translation')
\ No newline at end of file diff --git a/vendor/gems/gettext-2.1.0/test/tools/files/version.po b/vendor/gems/gettext-2.1.0/test/tools/files/version.po new file mode 100644 index 000000000..e4aaca21a --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/files/version.po @@ -0,0 +1,7 @@ +msgid "" +msgstr "" +"Project-Id-Version: ruby-gettext 2.0.0\n" +"Content-Type: text/plain; charset=UTF-8\n" + +msgid "x" +msgstr "x"
\ No newline at end of file diff --git a/vendor/gems/gettext-2.1.0/test/tools/test.pot b/vendor/gems/gettext-2.1.0/test/tools/test.pot new file mode 100644 index 000000000..772ecc07b --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/test.pot @@ -0,0 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: x\n" +"POT-Creation-Date: 2009-02-15 09:22+0100\n" +"PO-Revision-Date: 2009-02-15 09:22+0100\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: tools/files/simple_translation.rb:1 +msgid "a translation" +msgstr "" diff --git a/vendor/gems/gettext-2.1.0/test/tools/test_tools.rb b/vendor/gems/gettext-2.1.0/test/tools/test_tools.rb new file mode 100644 index 000000000..9f75f4e6a --- /dev/null +++ b/vendor/gems/gettext-2.1.0/test/tools/test_tools.rb @@ -0,0 +1,61 @@ +require 'testlib/helper' + +require 'gettext/tools' +class TestToolsTools < Test::Unit::TestCase + def setup + FileUtils.cp_r "tools/files", "tools/test_files" + end + def teardown + FileUtils.rm_rf "tools/test_files" + end + + def test_msgmerge_merges_old_and_new_po_file + GetText.msgmerge(path('simple_1.po'),path('simple_2.po'),'X',:msgmerge=>[:sort_output,:no_location]) + assert_equal File.read(path('simple_1.po')), <<EOF +msgid "a" +msgstr "b" + +#~ msgid "x" +#~ msgstr "y" +EOF + end + + def test_msgmerge_inserts_the_new_version + old = backup('version.po') + GetText.msgmerge(old,path('version.po'),'NEW') + assert File.read(old) =~ /"Project-Id-Version: NEW\\n"/ + end + + def test_update_pofiles_updates_a_single_language + GetText.update_pofiles('app',[path('simple_translation.rb')],'x',:po_root=>path('.'),:lang=>'en',:msgmerge=>[:no_location]) + text = <<EOF +msgid "a translation" +msgstr "" +EOF + assert_equal text, File.read(path('app.pot')) + assert_equal text, File.read(path('en/app.po')) + assert_equal '', File.read(path('de/app.po')) + end + + def test_update_pofiles_updates_creates_po_folder_if_missing + GetText.update_pofiles('app',[path('simple_translation.rb')],'x',:po_root=>path('./xx')) + assert File.exist?(path('xx/app.pot')) + end + + def test_create_mofiles_generates_mo_for_each_po + GetText.create_mofiles(:po_root=>path('.'),:mo_root=>path('mo')) + assert File.exist?(path('mo/en/LC_MESSAGES/app.mo')) + assert File.exist?(path('mo/de/LC_MESSAGES/app.mo')) + end +private + + def backup(name) + copy = path(name+".bak") + FileUtils.cp path(name), copy + copy + end + + def path(name) + File.join(File.dirname(__FILE__),'test_files',name) + end +end
\ No newline at end of file |