Sha256: 498b2ef583bb7b3cebca77a302530474dec5afd12630b46f1035a99d1be9db38

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

require 'fast_gettext/mo_file'
require 'fast_gettext/storage'
require 'fast_gettext/translation'
require 'fast_gettext/translation_repository'
require File.join(File.dirname(__FILE__),'..','vendor','string')

module FastGettext
  include FastGettext::Storage
  extend self

  VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
  LOCALE_REX =  /^[a-z]{2}$|^[a-z]{2}_[A-Z]{2}$/
  NAMESPACE_SEPERATOR = '|'

  # users should not include FastGettext, since this would conterminate their namespace
  # rather use
  # FastGettext.locale = ..
  # FastGettext.text_domain = ..
  # and
  # include FastGettext::Translation
  FastGettext::Translation.public_instance_methods.each do |method|
    define_method method do |*args|
      Translation.send(method,*args)
    end
  end

  def add_text_domain(name,options)
    translation_repositories[name] = TranslationRepository.build(name,options)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fast_gettext-0.5.2 lib/fast_gettext.rb
fast_gettext-0.5.1 lib/fast_gettext.rb
fast_gettext-0.4.17 lib/fast_gettext.rb
fast_gettext-0.4.16 lib/fast_gettext.rb