Sha256: 693c53fcbadd3366777d354e74d9e7153e872b0f7054b2691a84e1b8d7c62776
Contents?: true
Size: 1.01 KB
Versions: 4
Compression:
Stored size: 1.01 KB
Contents
#!/usr/bin/env ruby =begin helloerb2.cgi - Sample script for CGI/ERB Set locale/charset automaticaly. (from HTTP_ACCEPT_LANGUAGE, HTTP_ACCEPT_CHARSET sended by web browser). Recommanded to set UTF-8 forcely because some web browser doesn't send HTTP_ACCEPT_CHARSET correctly.(See helloerb.cgi) Copyright (C) 2005 Masao Mutoh You may redistribute it and/or modify it under the same license terms as Ruby. =end begin require 'rubygems' rescue LoadError end require 'gettext/cgi' require 'gettext/erb' class SimpleContainer2 include GetText::ErbContainer def initialize(domainname, domainpath) bindtextdomain(domainname, :path => domainpath) @domainname = domainname end def description _("Sample script for CGI/ERB (Auto-Detect charset).") end def to_html(path) eval_file(path) end end cgi = CGI.new GetText.set_cgi(cgi) print "Content-type:text/html; charset=#{Locale.get.charset}\n\n" con = SimpleContainer2.new("helloerb2", "locale") print con.to_html("helloerb.rhtml")
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
gettext-1.91.0 | samples/cgi/helloerb2.cgi |
gettext-1.90.0 | samples/cgi/helloerb2.cgi |
gettext-1.92.0 | samples/cgi/helloerb2.cgi |
gettext-1.93.0 | samples/cgi/helloerb2.cgi |