Sha256: 0eb38a784173a4e0a64d2c1116ed9d435e775a28ed5bf62f5c69760946e96c76

Contents?: true

Size: 929 Bytes

Versions: 18

Compression:

Stored size: 929 Bytes

Contents

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

Version data entries

18 entries across 18 versions & 4 rubygems

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