Sidekiq fails to send digest emails due to some missing translation data.
Here is the error, and the stacktrace:
Jobs::HandledExceptionWrapper: Wrapped I18n::MissingTranslationData: translation missing: en.time.formats.short
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n.rb:311:in `handle_exception'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n.rb:161:in `translate'
/var/www/discourse/lib/freedom_patches/translate_accelerator.rb:64:in `translate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n/backend/base.rb:59:in `localize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n.rb:247:in `localize'
/var/www/discourse/app/mailers/user_notifications.rb:48:in `rescue in short_date'
/var/www/discourse/app/mailers/user_notifications.rb:46:in `short_date'
/var/www/discourse/app/mailers/user_notifications.rb:60:in `digest'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.10/lib/abstract_controller/base.rb:189:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.10/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/callbacks.rb:82:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.10/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.10/lib/abstract_controller/base.rb:136:in `process'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionview-4.1.10/lib/action_view/rendering.rb:30:in `process'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionmailer-4.1.10/lib/action_mailer/base.rb:580:in `block in process'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/notifications.rb:159:in `block in instrument'
The forum is using the fr locale by default, and runs the latest stable version (1.3.2).
I dug through the code, and the offending blocks seems odd:
In user_notifications.rb
def short_date(dt)
I18n.l(dt, format: :short)
rescue I18n::MissingTranslationData
I18n.l(dt, format: :short, locale: 'en')
end
I’m no Ruby expert, and had trouble making sense of what I saw going deep into the rabbit hole of the ActiveSupport gem. Still, this part of the config/locales/server.en.yml file means that the fallback should work, at least:
datetime: &datetime
month_names:
[~, January, February, March, April, May, June, July, August, September, October, November, December]
formats:
short: "%m-%d-%Y"
short_no_year: "%B %-d"
date_only: "%B %-d, %Y"
date:
<<: *datetime
time:
<<: *datetime
What is going wrong? I don’t get it.