]> source.dussan.org Git - redmine.git/commitdiff
Update i18n gem to 1.5.3 (#29946).
authorGo MAEDA <maeda@farend.jp>
Tue, 19 Feb 2019 10:29:20 +0000 (10:29 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 19 Feb 2019 10:29:20 +0000 (10:29 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@17888 e93f8b46-1217-0410-a6f0-8f06a7374b81

Gemfile
config/application.rb
config/initializers/30-redmine.rb
lib/redmine/i18n.rb

diff --git a/Gemfile b/Gemfile
index 7335c5bd9fddbdfdb4f4e60ebe5d382b155a21c7..cc45316811f807cffb49a9abe54e21f23ea0c6b8 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -12,7 +12,7 @@ gem "mimemagic"
 gem "mail", "~> 2.7.1"
 gem "csv", "~> 3.0.1" if RUBY_VERSION < "2.6"
 gem "nokogiri", "~> 1.10.0"
-gem "i18n", "~> 0.7.0"
+gem "i18n", "~> 1.5.3"
 gem "rbpdf", "~> 1.19.6"
 
 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
index d77d37e705eceddcb22551782f71a696743c8c58..e182fc2b96a445b851e5a353a8baf712bff695e8 100644 (file)
@@ -28,7 +28,9 @@ module RedmineApp
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
     # config.i18n.default_locale = :de
 
-    I18n.enforce_available_locales = true
+    config.i18n.enforce_available_locales = true
+    config.i18n.fallbacks = true
+    config.i18n.default_locale = 'en'
 
     # Configure the default encoding used in templates for Ruby 1.9.
     config.encoding = "utf-8"
index 698c94e476f93b7172bc59e3e62d1cc530d87da0..bebed4acadc524216738a0e94a4c31bb1bcf256b 100644 (file)
@@ -1,4 +1,3 @@
-I18n.default_locale = 'en'
 I18n.backend = Redmine::I18n::Backend.new
 # Forces I18n to load available locales from the backend
 I18n.config.available_locales = nil
index 300fb8b0660e240e9a9c72640012eaee069ad253..cdac4ea771cb544c5d9ded3bed557973a09b1680 100644 (file)
@@ -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