Merge pull request #3792 from gschlager/i18n-patch3

FIX: I18n.exists? should use locale fallbacks
This commit is contained in:
Sam 2015-09-20 15:11:17 +10:00
commit 7b94dc8586
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
module I18n
module Backend
module Fallbacks
def exists?(locale, key)
I18n.fallbacks[locale].each do |fallback|
begin
return true if super(fallback, key)
rescue I18n::InvalidLocale
# we do nothing when the locale is invalid, as this is a fallback anyways.
end
end
false
end
end
end
end