Sha256: 1825985a2b2fae6dd87478a63741c89d9c251b9bf37d590c972c012e7c4dafc2
Contents?: true
Size: 568 Bytes
Versions: 1
Compression:
Stored size: 568 Bytes
Contents
# encoding: utf-8 module WebTranslateIt # Class to automatically fetch the last translations from Web Translate It # for every page requested. # This can be used as a rack middleware. # Implementation example: # # # in config/environment.rb: # config.middleware.use "WebTranslateIt::AutoFetch" # class AutoFetch def initialize(app) @app = app end def call(env) WebTranslateIt::fetch_translations unless env['REQUEST_PATH'] =~ /\.(js|css|jpeg|jpg|gif|png|woff)$/ I18n.reload! @app.call(env) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
web_translate_it-2.1.6 | lib/web_translate_it/auto_fetch.rb |