FIX: Catch InvalidPluralizationData exception in fallback locales

It shouldn't raise an exception when a pluralized string in a fallback locale is only partially translated.
This commit is contained in:
Gerhard Schlager 2019-05-11 01:50:17 +02:00
parent a3e4f43a4d
commit 6d44be5142
1 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,15 @@ module I18n
end
end
def pluralize(locale, entry, count)
begin
super
rescue I18n::InvalidPluralizationData => e
raise e if I18n.fallbacks[locale] == [locale]
throw(:exception, e)
end
end
def self.create_search_regexp(query, as_string: false)
regexp = Regexp.escape(query)