diff options
author | Ruben Davila <rdavila84@gmail.com> | 2017-05-04 05:05:38 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2017-05-04 05:08:43 +0300 |
commit | dbd1bdaeed596f14af89d662e73030bb02571cfd (patch) | |
tree | 16712553353aa5f4f43997863357da9fd0347ce9 /app/controllers/application_controller.rb | |
parent | b7f01f2b18940eb8dc0fa30e8ebbf1784c864304 (diff) |
More updates for translations plus some refactoring.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 14 |
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 |