Sha256: b9ce279fa560de3d066a8c60470eb7c99749e7352e4464e4d8ac3c3459492c45

Contents?: true

Size: 501 Bytes

Versions: 46

Compression:

Stored size: 501 Bytes

Contents

# -*- coding: utf-8 -*-
require 'jpmobile/lookup_context'

module ActionController
  class Base
    include Jpmobile::Helpers
    before_filter :gettext_force_ja_for_mobile
    # gettextが組み込まれている場合、携帯電話からのアクセスをjaロケールに強制する。
    def gettext_force_ja_for_mobile
      if Object.const_defined?(:GetText) and request.mobile?
        begin
          ::GetText.locale = 'ja'
        rescue NameError
        end
      end
    end
  end
end

Version data entries

46 entries across 43 versions & 1 rubygems

Version Path
jpmobile-3.0.9 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.8 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.7 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.11 lib/jpmobile/hook_action_controller.rb
jpmobile-1.0.12 lib/jpmobile/hook_action_controller.rb
jpmobile-1.0.11 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.10 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.6 lib/jpmobile/hook_action_controller.rb
jpmobile-1.0.10 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.9 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.5 lib/jpmobile/hook_action_controller.rb
jpmobile-1.0.9 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.8 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.4 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.3 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.2 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.1 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.7 lib/jpmobile/hook_action_controller.rb
jpmobile-2.0.6 lib/jpmobile/hook_action_controller.rb
jpmobile-3.0.0 lib/jpmobile/hook_action_controller.rb