Sha256: 1688528f2a10cc884ae5e30fd667da5f494531a3e41bd0af7ed2518966206635

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

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
    

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
experteer-gettext-2.0.4.1 test/testlib/ngettext.rb
experteer-gettext-2.0.4 test/testlib/ngettext.rb
fair-gettext-2.0.7 test/testlib/ngettext.rb
fair-gettext-2.0.6 test/testlib/ngettext.rb
fair-gettext-2.0.5 test/testlib/ngettext.rb
fair-gettext-2.0.4 test/testlib/ngettext.rb
fair-gettext-2.0.3 test/testlib/ngettext.rb
fair-gettext-2.0.2 test/testlib/ngettext.rb
fair-gettext-2.0.1 test/testlib/ngettext.rb
fair-gettext-2.0.0 test/testlib/ngettext.rb
gettext-2.1.0 test/testlib/ngettext.rb