Sha256: d1dc69d5ab349ea2869012b3151cc21844167c2aace9ef28f10c7702b520896d
Contents?: true
Size: 601 Bytes
Versions: 14
Compression:
Stored size: 601 Bytes
Contents
#!/usr/bin/ruby # hello_noop.rb - sample for N_() and class. # # Copyright (C) 2002-2006 Masao Mutoh # This file is distributed under the same license as Ruby-GetText-Package. require 'gettext' class HelloNoop include GetText MSGS = [N_("Hello World"), N_("Hello World2")] def initialize # You can call bindtextdomain as instance methods. # In this case, it initializes(decided the locale lazily) # in a instance. bindtextdomain("hello_noop", "locale") end def hello MSGS.each do |msg| print _(msg), "\n" end end end hello = HelloNoop.new hello.hello
Version data entries
14 entries across 14 versions & 1 rubygems