summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.rubocop_todo.yml1
-rw-r--r--lib/redmine/i18n.rb21
2 files changed, 11 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 528940a60..1c0f26bff 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -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:
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb
index 5621be68c..8343bccb0 100644
--- a/lib/redmine/i18n.rb
+++ b/lib/redmine/i18n.rb
@@ -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