mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 17:06:31 -06:00
DEV: Remove patch for I18n.exists?
It was merged upstream a long time ago
This commit is contained in:
parent
73015521e2
commit
a3e4f43a4d
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user