X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/10fb373e5e1fe6582e43f72556e5b15f86e6c20a..399fe3c12a7612f1ad79d376f2859d9c6fd38839:/config/initializers/http_accept_language.rb 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