mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Fallbacks for missing interpolation arguments
This takes effect when an interpolation is removed from a translation in a Discourse update. The I18n::Backend::Fallbacks loops with a catch(:exception), so calling throw(:exception) will cause it to use the next locale, until it reaches English which is assumed to be correct. Also, enable fallbacks in everything except development (#3724 for more discussion) - we should be able to test this
This commit is contained in:
parent
3c9a818a2f
commit
6119d9fdc0
@ -28,8 +28,10 @@ class NoFallbackLocaleList < FallbackLocaleList
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Rails.env.production?
|
|
||||||
I18n.fallbacks = FallbackLocaleList.new
|
if Rails.env.development?
|
||||||
else
|
|
||||||
I18n.fallbacks = NoFallbackLocaleList.new
|
I18n.fallbacks = NoFallbackLocaleList.new
|
||||||
|
else
|
||||||
|
I18n.fallbacks = FallbackLocaleList.new
|
||||||
|
I18n.config.missing_interpolation_argument_handler = proc { throw(:exception) }
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user