X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e660e609661edadc1ed5ad49d6e83e936b2f91cd..103ba7977f2cae8feb805225d3331d96b124e3ad:/config/initializers/http_accept_language.rb?ds=inline 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