mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
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:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user