mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +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:
parent
a3e4f43a4d
commit
6d44be5142
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue