Sha256: fe6d0f9c5067e03302b121ff1a6edeb69bc008890aed0b382d7d0104885db742

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

require 'gettext'

class TestNPGetText
  include GetText
  def initialize
    bindtextdomain("test_npgettext", "locale")
  end

  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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gettext-1.93.0 test/testlib/npgettext.rb