Sha256: 8bdf9485e2534441d0fa09aa5f56c680c335f61ac0dca5a122b7f6a6ed4fd035

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

module Localization
  extend Log
  DEFAULT_LANGUAGE = :en
  RESOURCE_EXTENSION = "localization.yaml"

  class << self
    def default_language= lang
      @default_language = lang
    end

    def default_language
      @default_language ||= DEFAULT_LANGUAGE
    end

    def language= block
      @language = block
    end

    def language
      if @language
        lang = @language.call
        return lang || default_language
      else
        return default_language
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-ext-0.4.1 old/lib/RubyExt/Localization.rb
ruby-ext-0.4.0 old/lib/RubyExt/Localization.rb