aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/gettext-2.1.0/test/testlib/gettext.rb
diff options
context:
space:
mode:
authorRobin Houston <robin@lenny.robin>2011-06-09 12:54:05 +0100
committerRobin Houston <robin@lenny.robin>2011-06-09 12:54:05 +0100
commit4d077dc48fb0589dbf401a131d524b23ab0d2258 (patch)
tree680b12febc448827ee937039d38e97020b4c5df9 /vendor/gems/gettext-2.1.0/test/testlib/gettext.rb
parentcb67f4d0ef9feae96a90ea5bba63c939268b1224 (diff)
Bundle the locale and gettext gems
Diffstat (limited to 'vendor/gems/gettext-2.1.0/test/testlib/gettext.rb')
-rw-r--r--vendor/gems/gettext-2.1.0/test/testlib/gettext.rb113
1 files changed, 113 insertions, 0 deletions
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&ccedil;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