Sha256: e23c6ea7aba14349b6892e35b0dc82a884239b778997f49daa29c817247d68de

Contents?: true

Size: 467 Bytes

Versions: 2

Compression:

Stored size: 467 Bytes

Contents

module Trendi18n
  module Handler

    def self.included(subclass)
      subclass.class_eval do
        before_filter :translations_cache_updater

        # check translations cache up-to-date status and reload backend or/and locales when needed
        def translations_cache_updater
          I18n.backend.reload! unless I18n.backend.up_to_date?
          I18n.backend.locales_reload! unless I18n.backend.locales_up_to_date?
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trendi18n-0.9.3 lib/trendi18n/handler.rb
trendi18n-0.9.2 lib/trendi18n/handler.rb