class ActionController::Base

Public Instance Methods

gettext_force_ja_for_mobile() click to toggle source

gettextが組み込まれている場合、携帯電話からのアクセスをjaロケールに強制する。

# File lib/jpmobile/hook_action_controller.rb, line 8
def gettext_force_ja_for_mobile
  if Object.const_defined?(:GetText) and request.mobile?
    begin
      ::GetText.locale = 'ja'
    rescue NameError
    end
  end
end