Skip to content

Commit

Permalink
Update available locale check in Simple backend
Browse files Browse the repository at this point in the history
This reduces some duplication in the Simple backend by leveraging a check that will validate both string and symbols against a set of available locales.
  • Loading branch information
codealchemy committed May 6, 2021
1 parent f19ee0d commit 346f1cd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/i18n/backend/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def initialized?
def store_translations(locale, data, options = EMPTY_HASH)
if I18n.enforce_available_locales &&
I18n.available_locales_initialized? &&
!I18n.available_locales.include?(locale.to_sym) &&
!I18n.available_locales.include?(locale.to_s)
!I18n.locale_available?(locale)
return data
end
locale = locale.to_sym
Expand Down

0 comments on commit 346f1cd

Please sign in to comment.