##// END OF EJS Templates
2.6-stable: fix r13807 on Ruby 1.8.7...
Toshi MARUYAMA -
r13435:158a01f2b7a8
parent child
Show More
@@ -103,7 +103,13 module Redmine
103 languages_options :cache => false
103 languages_options :cache => false
104 end
104 end
105 end
105 end
106 options.map {|name, lang| [name.force_encoding("UTF-8"), lang.force_encoding("UTF-8")]}
106 options.map do |name, lang|
107 n = name
108 l = lang
109 n.force_encoding("UTF-8") if n.respond_to?(:force_encoding)
110 l.force_encoding("UTF-8") if l.respond_to?(:force_encoding)
111 [n, l]
112 end
107 end
113 end
108
114
109 def find_language(lang)
115 def find_language(lang)
@@ -199,8 +199,10 class Redmine::I18nTest < ActiveSupport::TestCase
199 end
199 end
200
200
201 def test_languages_options_should_return_strings_with_utf8_encoding
201 def test_languages_options_should_return_strings_with_utf8_encoding
202 strings = languages_options.flatten
202 if "".respond_to?(:force_encoding)
203 assert_equal ["UTF-8"], strings.map(&:encoding).uniq.map(&:name).sort
203 strings = languages_options.flatten
204 assert_equal ["UTF-8"], strings.map(&:encoding).uniq.map(&:name).sort
205 end
204 end
206 end
205
207
206 def test_languages_options_should_ignore_locales_without_general_lang_name_key
208 def test_languages_options_should_ignore_locales_without_general_lang_name_key
General Comments 0
You need to be logged in to leave comments. Login now