2 # Monkey patch HttpAcceptLanguage pending integration of
3 # https://github.com/iain/http_accept_language/pull/6
5 module HttpAcceptLanguage
6 def compatible_language_from(available_languages)
7 user_preferred_languages.find do |x|
8 available_languages.find { |y| y.to_s == x.to_s } ||
9 available_languages.find { |y| y.to_s =~ /^#{Regexp.escape(x.to_s)}-/ }