Sha256: a43e372f23fa98bb2fc72b5b607a0a86b07333db26e8043d425ff668e7124cae

Contents?: true

Size: 1.32 KB

Versions: 8

Compression:

Stored size: 1.32 KB

Contents

=begin
  gettext/erb.rb - Class-based container module for GetText 

  Copyright (C) 2005,2006  Masao Mutoh

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

  $Id: container.rb,v 1.4 2006/02/23 14:53:59 mutoh Exp $
=end

require 'gettext'

module GetText
  # This module is used instead of GetText module. This module provides same functions as GetText module.
  #
  # Normaly, GetText.bindtexdomain should be called once a ruby-script-file.
  # But if the class includes GetText::Container, a TextDomain is bound to an instance of the class. 
  # So you don't need to call bindtextdomain in each files if the files define a class.
  # 
  # This module is useful for application-side classes, but you shouldn't use this for libraries. 
  # Because the user of your library may override/add new features to the original library and the 
  # user needs to prepare another TextDomain(Otherwise, apply po/mo patch to the original library).
  module Container
    include GetText

    alias :_bindtextdomain :bindtextdomain #:nodoc:

    def bindtextdomain(domainname, path = nil, locale = nil, charset = nil) #:nodoc:
      @gettext_container_domainname = domainname
      _bindtextdomain(domainname, path, locale, charset)
    end

    def callersrc #:nodoc:
      @gettext_container_domainname
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gettext-1.5.0-mswin32 lib/gettext/container.rb
gettext-1.4.0-mswin32 lib/gettext/container.rb
gettext-1.3.0-mswin32 lib/gettext/container.rb
gettext-1.2.0-mswin32 lib/gettext/container.rb
gettext-1.2.0 lib/gettext/container.rb
gettext-1.5.0 lib/gettext/container.rb
gettext-1.3.0 lib/gettext/container.rb
gettext-1.4.0 lib/gettext/container.rb