<NME> application_controller.rb
<BEF> class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :authenticate_user!

  # Handle unauthorized access with a good old fashioned 'forbidden'
  rescue_from CanCan::AccessDenied do |exception|
  protected
  def render_404
    respond_to do |format|
      format.html do
        render :file => Rails.root.join('public', '404.html'),
          :status => '404'
      end
      format.xml do
        render :nothing => true, :status => '404'
      end
    end
  end

  private 
      end
    end
  end
end

<MSG> Localization support for application

<DFF> @@ -1,7 +1,7 @@
 class ApplicationController < ActionController::Base
   protect_from_forgery
 
-  before_filter :authenticate_user!
+  before_filter :authenticate_user!, :set_locale
 
   # Handle unauthorized access with a good old fashioned 'forbidden'
   rescue_from CanCan::AccessDenied do |exception|
@@ -22,4 +22,12 @@ class ApplicationController < ActionController::Base
       end
     end
   end
+
+  private 
+
+  def set_locale
+    if !current_user.nil? && !current_user.locale.nil?
+      I18n.locale = current_user.locale.to_sym 
+    end
+  end
 end

{'addition_count': 9, 'commit_subject': 'Localization support for application', 'deletion_count': 1, 'file_extension': '.rb', 'lang': 'rb', 'license': 'agpl-3.0', 'repo_name': 'fulcrum-agile/fulcrum'}