Skip to content
Browse files

Don't downcase language code for priority languages

  • Loading branch information...
1 parent 3033456 commit 253d2cc67698bb9a0a0e569725b9ec3bb7fdbffe @davec committed Apr 10, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/localized_language_select.rb
  2. +2 −2 test/localized_language_select_test.rb
View
2 lib/localized_language_select.rb
@@ -50,7 +50,7 @@ def include_language?(key, options)
# # => [ ['German', 'de'], ['French', 'fr'], ['English', 'en'] ]
def priority_languages_array(language_codes=[])
languages = I18n.translate(:languages)
- language_codes.map { |code| [languages[code], code.to_s.downcase] }
+ language_codes.map { |code| [languages[code], code.to_s] }
end
end
end
View
4 test/localized_language_select_test.rb
@@ -54,8 +54,8 @@ def test_should_return_localized_country_option_tags
end
def test_should_return_priority_languages_first
- assert localized_language_options_for_select(nil, [:es, :fr]) =~ Regexp.new(
- Regexp.escape("<option value=\"es\">Spanish</option>\n<option value=\"fr\">French</option><option value=\"\" disabled=\"disabled\">-------------</option>\n<option value=\"ab\">Abkhazian</option>\n"))
+ assert localized_language_options_for_select(nil, [:es, :fr, :"nl-BE"]) =~ Regexp.new(
+ Regexp.escape("<option value=\"es\">Spanish</option>\n<option value=\"fr\">French</option>\n<option value=\"nl-BE\">Flemish</option><option value=\"\" disabled=\"disabled\">-------------</option>\n<option value=\"ab\">Abkhazian</option>\n"))
end
def test_i18n_should_know_about_languages

0 comments on commit 253d2cc

Please sign in to comment.
Something went wrong with that request. Please try again.