samples/cgi/helloerb1.cgi in gettext-1.10.0-mswin32 vs samples/cgi/helloerb1.cgi in gettext-1.90.0
- old
+ new
@@ -21,12 +21,13 @@
require 'gettext/erb'
class SimpleContainer1
include GetText::ErbContainer
- def initialize(domainname, domainpath = nil, locale = nil, charset = nil)
- bindtextdomain(domainname, domainpath, locale)
+ def initialize(domainname, domainpath, cgi)
+ set_cgi(cgi)
+ bindtextdomain(domainname, :path => domainpath)
@domainname = domainname
end
def description
_("Sample script for CGI/ERB (UTF-8).")
@@ -40,10 +41,12 @@
GetText.output_charset = "UTF-8"
print "Content-type:text/html; charset=UTF-8\n\n"
-con = SimpleContainer1.new("helloerb1", "locale")
+cgi = CGI.new
+
+con = SimpleContainer1.new("helloerb1", "locale", cgi)
if GetText.cgi["other"] == "true"
print con.to_html("other.rhtml")
else
print con.to_html("helloerb.rhtml")