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:
parent
a3e4f43a4d
commit
6d44be5142
|
@ -25,6 +25,15 @@ module I18n
|
||||||
end
|
end
|
||||||
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)
|
def self.create_search_regexp(query, as_string: false)
|
||||||
regexp = Regexp.escape(query)
|
regexp = Regexp.escape(query)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue