[DRE-commits] [SCM] redmine.git branch, master-experimental, updated. debian/1.4.4+dfsg1-1-93-gbf76368

Ondřej Surý ondrej at sury.org
Thu Mar 21 14:37:25 UTC 2013


The following commit has been merged in the master-experimental branch:
commit c45c665cfdab2e662180287836b6300e19eb5fe5
Author: Ondřej Surý <ondrej at sury.org>
Date:   Wed Mar 20 15:00:20 2013 +0100

    Add patch which reverts I18N caching and fix Redmine issue #13520

diff --git a/debian/patches/revert-r10844.diff b/debian/patches/revert-r10844.diff
new file mode 100644
index 0000000..c48b2bc
--- /dev/null
+++ b/debian/patches/revert-r10844.diff
@@ -0,0 +1,51 @@
+--- a/app/helpers/application_helper.rb
++++ b/app/helpers/application_helper.rb
+@@ -926,7 +926,8 @@ module ApplicationHelper
+   end
+ 
+   def lang_options_for_select(blank=true)
+-    (blank ? [["(auto)", ""]] : []) + languages_options
++    (blank ? [["(auto)", ""]] : []) +
++      valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name), lang.to_s]}.sort{|x,y| x.last <=> y.last }
+   end
+ 
+   def label_tag_for(name, option_tags = nil, options = {})
+--- a/lib/redmine/i18n.rb
++++ b/lib/redmine/i18n.rb
+@@ -87,16 +87,6 @@ module Redmine
+       ::I18n.available_locales
+     end
+ 
+-    # Returns an array of languages names and code sorted by names, example:
+-    # [["Deutsch", "de"], ["English", "en"] ...]
+-    #
+-    # The result is cached to prevent from loading all translations files.
+-    def languages_options
+-      ActionController::Base.cache_store.fetch "i18n/languages_options" do
+-        valid_languages.map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}.sort {|x,y| x.first <=> y.first }
+-      end      
+-    end
+-
+     def find_language(lang)
+       @@languages_lookup = valid_languages.inject({}) {|k, v| k[v.to_s.downcase] = v; k }
+       @@languages_lookup[lang.to_s.downcase]
+--- a/test/unit/lib/redmine/i18n_test.rb
++++ b/test/unit/lib/redmine/i18n_test.rb
+@@ -194,17 +194,6 @@ class Redmine::I18nTest < ActiveSupport:
+     assert valid_languages.first.is_a?(Symbol)
+   end
+ 
+-  def test_languages_options
+-    options = languages_options
+-
+-    assert options.is_a?(Array)
+-    assert_equal valid_languages.size, options.size
+-    assert_nil options.detect {|option| !option.is_a?(Array)}
+-    assert_nil options.detect {|option| option.size != 2}
+-    assert_nil options.detect {|option| !option.first.is_a?(String) || !option.last.is_a?(String)}
+-    assert_include ["English", "en"], options
+-  end
+-
+   def test_locales_validness
+     lang_files_count = Dir["#{Rails.root}/config/locales/*.yml"].size
+     assert_equal lang_files_count, valid_languages.size
diff --git a/debian/patches/series b/debian/patches/series
index 5cb94da..54c7665 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 2009_FHS_thin_config.patch
 2017_Gemfile_debian.patch
 2018_get_rid_of_rdoctask.patch
+revert-r10844.diff

-- 
redmine.git



More information about the Pkg-ruby-extras-commits mailing list