Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-04 05:05:38 +0300
committerRuben Davila <rdavila84@gmail.com>2017-05-04 05:08:43 +0300
commitdbd1bdaeed596f14af89d662e73030bb02571cfd (patch)
tree16712553353aa5f4f43997863357da9fd0347ce9 /app/controllers/application_controller.rb
parentb7f01f2b18940eb8dc0fa30e8ebbf1784c864304 (diff)
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