Sha256: 8bdd2da950499d8b04a529ceba8c60183755e6a8ea6366d006904cfdbe3b1fff

Contents?: true

Size: 818 Bytes

Versions: 51

Compression:

Stored size: 818 Bytes

Contents

# -*- coding: utf-8 -*-

=begin
  gettext/cgi.rb - GetText for CGI

  Copyright (C) 2005-2009  Masao Mutoh

  You may redistribute it and/or modify it under the same
  license terms as Ruby or LGPL.
=end

require 'cgi'
require 'gettext'

Locale.init(:driver => :cgi)

module GetText

  # Sets a CGI object. This methods is appeared when requiring "gettext/cgi".
  # * cgi_: CGI object
  # * Returns: self
  def set_cgi(cgi_)
    Locale.set_cgi(cgi_)
  end

  # Same as GetText.set_cgi. This methods is appeared when requiring "gettext/cgi".
  # * cgi_: CGI object
  # * Returns: cgi_
  def cgi=(cgi_)
    set_cgi(cgi_)
    cgi_
  end

  # Gets the CGI object. If it is nil, returns new CGI object. This methods is appeared when requiring "gettext/cgi".
  # * Returns: the CGI object
  def cgi
    Locale.cgi
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
gettext-3.3.0 lib/gettext/cgi.rb
gettext-3.2.9 lib/gettext/cgi.rb
gettext-3.2.8 lib/gettext/cgi.rb
gettext-3.2.7 lib/gettext/cgi.rb
gettext-3.2.6 lib/gettext/cgi.rb
gettext-3.2.5 lib/gettext/cgi.rb
gettext-3.2.4 lib/gettext/cgi.rb
gettext-3.2.3 lib/gettext/cgi.rb
gettext-3.2.2 lib/gettext/cgi.rb
gettext-3.2.1 lib/gettext/cgi.rb
gettext-3.2.0 lib/gettext/cgi.rb
gettext-3.1.9 lib/gettext/cgi.rb
gettext-3.1.8 lib/gettext/cgi.rb
gettext-3.1.7 lib/gettext/cgi.rb
gettext-3.1.6 lib/gettext/cgi.rb
gettext-3.1.5 lib/gettext/cgi.rb
gettext-3.1.4 lib/gettext/cgi.rb
gettext-3.1.3 lib/gettext/cgi.rb
gettext-3.1.2 lib/gettext/cgi.rb
gettext-3.1.1 lib/gettext/cgi.rb