DEV: Remove patch for I18n.exists?

It was merged upstream a long time ago
This commit is contained in:
Gerhard Schlager 2019-05-11 01:43:48 +02:00
parent 73015521e2
commit a3e4f43a4d
2 changed files with 3 additions and 19 deletions

View File

@ -58,7 +58,7 @@ module I18n
end
def ensure_all_loaded!
backend.fallbacks(locale).each { |l| ensure_loaded!(l) }
I18n.fallbacks[locale].each { |l| ensure_loaded!(l) }
end
def search(query, opts = {})
@ -153,7 +153,7 @@ module I18n
if @overrides_enabled
overrides = {}
backend.fallbacks(locale).each do |l|
I18n.fallbacks[locale].each do |l|
overrides[l] = overrides_by_locale(l)
end

View File

@ -25,22 +25,6 @@ module I18n
end
end
def fallbacks(locale)
I18n.fallbacks[locale]
end
def exists?(locale, key)
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
def self.create_search_regexp(query, as_string: false)
regexp = Regexp.escape(query)
@ -55,7 +39,7 @@ module I18n
results = {}
regexp = self.class.create_search_regexp(query)
fallbacks(locale).each do |fallback|
I18n.fallbacks[locale].each do |fallback|
find_results(regexp, results, translations[fallback])
end