Skip to content

Commit eb8c3f7

Browse files
committed
Adds before_filter to application controller to set locale based on params
1 parent 23f78cb commit eb8c3f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/controllers/application_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ class ApplicationController < ActionController::Base
88
helper_method :current_user
99
helper_method :current_service
1010

11+
before_action :set_locale
12+
13+
def set_locale
14+
I18n.locale = params[:locale] || I18n.default_locale
15+
end
16+
1117
protected
1218

1319
def current_user

0 commit comments

Comments
 (0)