diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-03-12 13:05:19 +0000 |
commit | 37bff4c0154b57b35a3194a9b31a9422496b955b (patch) | |
tree | 61592a6bb9d1d9fea378a6e4efa8fdf7d5525b8a /vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi | |
parent | 8b49dc894066e452232cabd09333895487f86986 (diff) | |
parent | 8acea24f98268fbb9b73b66b9e98a1788a3b30ac (diff) |
Merge branch 'merged-bundler' into develop
Diffstat (limited to 'vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi')
-rwxr-xr-x | vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi b/vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi deleted file mode 100755 index 8a4971e1d..000000000 --- a/vendor/gems/gettext-2.1.0/samples/cgi/cookie.cgi +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env ruby -=begin - cookie.cgi - Set a selected locale to the cookie of WWW Browser. - - Set UTF-8 forcely as output charset. - - Recommanded to set UTF-8 forcely because some web browser - doesn't send HTTP_ACCEPT_CHARSET correctly. - - Copyright (C) 2005 Masao Mutoh - - You may redistribute it and/or modify it under the same - license terms as Ruby. -=end -$:.insert(0, "../../lib") - -# gettext/cgi support CGI. -begin - require 'rubygems' -rescue LoadError -end - -require 'gettext/cgi' - -include GetText - -# Configure GetText first. -set_output_charset("UTF-8") -set_cgi(CGI.new) -bindtextdomain("main", "locale") - -lang = GetText.cgi['lang'] -lang = "en" unless lang.size > 0 - -# -# CGI part -# -print "Set-Cookie:lang=#{lang}\n" -print "Content-type:text/html; charset=UTF-8\n\n" - -puts %Q[ -<head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - <link rel="stylesheet" type="text/css" href="gettext.css" media="all"> - <title>] -puts _("Sample script for CGI/ERB and Ruby-GetText-Package") -puts %Q[</title> -</head> -<body> -] - -puts "<h1>" + _("Set [%s] as the cookie of your WWW Browser.") % lang + "</h1>" - -puts %Q[</h1> - <p><a href="/">] -puts _("Back") -puts %Q[</a></p> - <div style="text-align:right"> - <p>Copyright (C) 2005 Masao Mutoh</p> - </div> - </body> -</html> -] - |