X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/d0b845fc6025f2fb84a4cf4fa10cbb71084843a7..8cdee8e0c75e6e62742eabc19bd8559cb13d5072:/vendor/plugins/http_accept_language/lib/http_accept_language.rb diff --git a/vendor/plugins/http_accept_language/lib/http_accept_language.rb b/vendor/plugins/http_accept_language/lib/http_accept_language.rb index 85ee89c95..1266a3e64 100644 --- a/vendor/plugins/http_accept_language/lib/http_accept_language.rb +++ b/vendor/plugins/http_accept_language/lib/http_accept_language.rb @@ -48,9 +48,8 @@ module HttpAcceptLanguage # def compatible_language_from(array) user_preferred_languages.map do |x| - x = x.to_s.split("-")[0] array.find do |y| - y.to_s.split("-")[0] == x + y.to_s =~ /^#{Regexp.escape(x.to_s)}(-|$)/ end end.compact.first end