h1onE
2 augustus 2015 om 13:08
1
Jobs::HandledExceptionWrapper: Wrapped I18n::MissingInterpolationArgument: missing interpolation argument
gerhard
(Gerhard Schlager)
2 augustus 2015 om 19:14
2
I fixed the translation in Transifex. This should be fixed the next times translations get pulled into Discourse.
@techAPJ I feel like Discourse shouldnât stop working when translations have missing interpolation arguments. Can we filter invalid translations during the pull from Transifex or somehow use the English locale when such an error occurs?
I thought the change to use English locale as fallback, which @riking worked on, was already in?
riking
(Kane York)
2 augustus 2015 om 21:52
4
It doesnât cover the case of bad interpolations yet, just missing translations.
4 likes
ndalliard
(Nate D.)
4 augustus 2015 om 07:35
5
Can someone just shortly explain me how that works? When will translation get pulled into discourse?
gerhard
(Gerhard Schlager)
4 augustus 2015 om 07:43
6
Itâs a manual process and usually itâs done every Wednesday, but I guess itâs vacation time, so donât count on itâŠ
If you canât wait, take a look at the locale-override plugin .
2 likes
techAPJ
(Arpit Jalan)
4 augustus 2015 om 07:56
7
Translations are usually updated twice a week (Monday and Thursday). I just pushed the new translations:
committed 07:47AM - 04 Aug 15 UTC
5 likes
gerhard
(Gerhard Schlager)
11 september 2015 om 18:44
8
@riking implemented a proper fix for this. This can be closed.
master â riking:patch-6
merged 06:11PM - 11 Sep 15 UTC
This takes effect when an interpolation is removed from a translation in
a Disco⊠urse update.
How this works:
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.
```
I18n.fallbacks[locale].each do |fallback|
begin
catch(:exception) do
result = super(fallback, key, options)
return result unless result.nil?
end
rescue I18n::InvalidLocale
# we do nothing when the locale is invalid, as this is a fallback anyways.
end
end
```
Also, enable fallbacks in everything except development (#3724 for more discussion) - we should be able to test the fallbacks.
3 likes