X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/e660e609661edadc1ed5ad49d6e83e936b2f91cd..41e45bad51c90dd4e131068ba1cfc1dd1184155f:/config/initializers/http_accept_language.rb?ds=sidebyside diff --git a/config/initializers/http_accept_language.rb b/config/initializers/http_accept_language.rb index 04c3dfaf5..2e5c92df1 100644 --- a/config/initializers/http_accept_language.rb +++ b/config/initializers/http_accept_language.rb @@ -3,10 +3,12 @@ # https://github.com/iain/http_accept_language/pull/6 # module HttpAcceptLanguage - def compatible_language_from(available_languages) - user_preferred_languages.find do |x| - available_languages.find { |y| y.to_s == x.to_s } || - available_languages.find { |y| y.to_s =~ /^#{Regexp.escape(x.to_s)}-/ } + class Parser + def compatible_language_from(available_languages) + user_preferred_languages.find do |x| + available_languages.find { |y| y.to_s == x.to_s } || + available_languages.find { |y| y.to_s =~ /^#{Regexp.escape(x.to_s)}-/ } + end end end end