mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 22:33:53 +08:00
18 lines
388 B
Ruby
18 lines
388 B
Ruby
|
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
|