]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Layout/ElseAlignment in lib/redmine/i18n.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 11:22:17 +0000 (11:22 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 11:22:17 +0000 (11:22 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18704 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
lib/redmine/i18n.rb

index 528940a60088b9b9f0d125163f8d5d3dc05e7786..1c0f26bffc67d7df14610611052b562d5ffd293a 100644 (file)
@@ -109,7 +109,6 @@ Layout/ElseAlignment:
     - 'app/helpers/queries_helper.rb'
     - 'app/models/issue_query.rb'
     - 'lib/redmine/export/pdf/issues_pdf_helper.rb'
-    - 'lib/redmine/i18n.rb'
 
 # Cop supports --auto-correct.
 Layout/EmptyLineAfterGuardClause:
index 5621be68cbc5669a68d2549e176598fcebb36a66..8343bccb047949455368a5e981713bcc3118057f 100644 (file)
@@ -117,17 +117,18 @@ module Redmine
     # The result is cached to prevent from loading all translations files
     # unless :cache => false option is given
     def languages_options(options={})
-      options = if options[:cache] == false
-        available_locales = ::I18n.backend.available_locales
-        valid_languages.
-          select {|locale| available_locales.include?(locale)}.
-          map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}.
-          sort_by(&:first)
-      else
-        ActionController::Base.cache_store.fetch "i18n/languages_options/#{Redmine::VERSION}" do
-          languages_options :cache => false
+      options =
+        if options[:cache] == false
+          available_locales = ::I18n.backend.available_locales
+          valid_languages.
+            select {|locale| available_locales.include?(locale)}.
+            map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}.
+            sort_by(&:first)
+        else
+          ActionController::Base.cache_store.fetch "i18n/languages_options/#{Redmine::VERSION}" do
+            languages_options :cache => false
+          end
         end
-      end
       options.map {|name, lang| [name.force_encoding("UTF-8"), lang.force_encoding("UTF-8")]}
     end