summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-03 21:05:38 -0500
committerRuben Davila <rdavila84@gmail.com>2017-05-03 21:08:43 -0500
commitdbd1bdaeed596f14af89d662e73030bb02571cfd (patch)
tree16712553353aa5f4f43997863357da9fd0347ce9 /app/controllers/application_controller.rb
parentb7f01f2b18940eb8dc0fa30e8ebbf1784c864304 (diff)
downloadgitlab-ce-dbd1bdaeed596f14af89d662e73030bb02571cfd.tar.gz
More updates for translations plus some refactoring.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 24017e8ea40..d2c13da6917 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -273,14 +273,10 @@ class ApplicationController < ActionController::Base
end
def set_locale
- begin
- requested_locale = current_user&.preferred_language || I18n.default_locale
- locale = FastGettext.set_locale(requested_locale)
- I18n.locale = locale
-
- yield
- ensure
- I18n.locale = I18n.default_locale
- end
+ Gitlab::I18n.set_locale(current_user)
+
+ yield
+ ensure
+ Gitlab::I18n.reset_locale
end
end