Sha256: 4046bb77164ccbbf310c86a987ef1e3282313504626546ea5777f94b55c645b3

Contents?: true

Size: 748 Bytes

Versions: 70

Compression:

Stored size: 748 Bytes

Contents

require 'rubygems'
require 'bundler/setup'

require 'r18n-core'

module RubyApp
  require 'ruby_app/application'
  require 'ruby_app/mixins/delegate_mixin'
  require 'ruby_app/request'

  class Language < R18n::I18n
    extend RubyApp::Mixins::DelegateMixin

    def self.get
      R18n.get
    end

    def self.load!
      R18n.thread_set(RubyApp::Language.new(RubyApp::Request.language, RubyApp::Application.options.translations_paths))
      if block_given?
        begin
          yield
        ensure
          self.unload!
        end
      end
    end

    def self.unload!
      R18n.thread_set(nil)
    end

    private

      def initialize(language, translations_paths)
        super(language, translations_paths)
      end

  end

end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
RubyApp-0.0.91 lib/ruby_app/language.rb
RubyApp-0.0.90 lib/ruby_app/language.rb
RubyApp-0.0.89 lib/ruby_app/language.rb
RubyApp-0.0.88 lib/ruby_app/language.rb
RubyApp-0.0.87 lib/ruby_app/language.rb
RubyApp-0.0.86 lib/ruby_app/language.rb
RubyApp-0.0.85 lib/ruby_app/language.rb
RubyApp-0.0.84 lib/ruby_app/language.rb
RubyApp-0.0.83 lib/ruby_app/language.rb
RubyApp-0.0.82 lib/ruby_app/language.rb
RubyApp-0.0.81 lib/ruby_app/language.rb
RubyApp-0.0.80 lib/ruby_app/language.rb
RubyApp-0.0.79 lib/ruby_app/language.rb
RubyApp-0.0.78 lib/ruby_app/language.rb
RubyApp-0.0.77 lib/ruby_app/language.rb
RubyApp-0.0.76 lib/ruby_app/language.rb
RubyApp-0.0.75 lib/ruby_app/language.rb
RubyApp-0.0.74 lib/ruby_app/language.rb
RubyApp-0.0.73 lib/ruby_app/language.rb
RubyApp-0.0.72 lib/ruby_app/language.rb