lib/fast_gettext/storage.rb in fast_gettext-2.0.3 vs lib/fast_gettext/storage.rb in fast_gettext-2.1.0

- old
+ new

@@ -170,10 +170,10 @@ # de-de,de;q=0.9,en;q=0.8 => [['de-de','de','0.5'], ['en','0.8']] def weighted_locales(locales) locales = locales.to_s.gsub(/\s/, '') found = [[]] locales.split(',').each do |part| - if /;q=/.match?(part) # contains language and weight ? + if part.include? ';q=' # contains language and weight ? found.last << part.split(/;q=/) found.last.flatten! found << [] else found.last << part