Skip to content

Commit

Permalink
Merge pull request #406 from jhawthorn/optimize_available_locales
Browse files Browse the repository at this point in the history
Optimize Backend::Simple#available_locales
  • Loading branch information
radar authored Feb 9, 2018
2 parents 7c6ccf4 + 7eb3576 commit 9ddc9f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/i18n/backend/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def store_translations(locale, data, options = {})
def available_locales
init_translations unless initialized?
translations.inject([]) do |locales, (locale, data)|
locales << locale unless (data.keys - [:i18n]).empty?
locales << locale unless data.size <= 1 && (data.empty? || data.has_key?(:i18n))
locales
end
end
Expand Down

0 comments on commit 9ddc9f5

Please sign in to comment.