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