h1onE
2 באוגוסט, 2015, 1:08pm
1
Jobs::HandledExceptionWrapper: Wrapped I18n::MissingInterpolationArgument: missing interpolation argument
gerhard
(Gerhard Schlager)
2 באוגוסט, 2015, 7:14pm
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 באוגוסט, 2015, 9:52pm
4
It doesn’t cover the case of bad interpolations yet, just missing translations.
4 לייקים
ndalliard
(Nate D.)
4 באוגוסט, 2015, 7:35am
5
Can someone just shortly explain me how that works? When will translation get pulled into discourse?
gerhard
(Gerhard Schlager)
4 באוגוסט, 2015, 7:43am
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 לייקים
techAPJ
(Arpit Jalan)
4 באוגוסט, 2015, 7:56am
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 לייקים
gerhard
(Gerhard Schlager)
11 בספטמבר, 2015, 6:44pm
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 לייקים