summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-02-19 10:29:20 +0000
committerGo MAEDA <maeda@farend.jp>2019-02-19 10:29:20 +0000
commit7d03c9c6ed83d87e81da6d4a92d603261b7e78e5 (patch)
treea1c0f05b711e2634fbdc24ce8149e7fe8a618721 /lib
parent158392ae930b04d3642f224da3c33cb5f2801435 (diff)
downloadredmine-7d03c9c6ed83d87e81da6d4a92d603261b7e78e5.tar.gz
redmine-7d03c9c6ed83d87e81da6d4a92d603261b7e78e5.zip
Update i18n gem to 1.5.3 (#29946).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17888 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/i18n.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb
index 300fb8b06..cdac4ea77 100644
--- a/lib/redmine/i18n.rb
+++ b/lib/redmine/i18n.rb
@@ -61,7 +61,7 @@ module Redmine
# Localizes the given args with user's language
def lu(user, *args)
lang = user.try(:language).presence || Setting.default_language
- ll(lang, *args)
+ ll(lang, *args)
end
def format_date(date)
@@ -117,8 +117,9 @@ module Redmine
# 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| ::I18n.exists?(:general_lang_name, locale)}.
+ select {|locale| available_locales.include?(locale)}.
map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}.
sort_by(&:first)
else