I can’t get delayed_job using the LOCALE file (fr in my case).
The Order Details emails received are in english while my staging instance in v1.3.1 with the fr LOCALE.
I have tried:
adding LOCALE=“fr” in .profile and in .bashrc of the user that monit is using
trying to start delayed_job manually (i.e. without monit) with the same user (running ruby ~/apps/openfoodnetwork/current/script/delayed_job -i 0 start)
modifying the start line in monit for openfoodnetwork start program = "/bin/bash -c 'LOCALE=fr RAILS_ENV=staging /home/offrance/.rbenv/shims/ruby /home/offrance/apps/openfoodnetwork/current/script/delayed_job -i 0 start'"
I haven’t encountered this before, but I have an approach that you could try as a start to an investigation.
The locale should be reading from config/application.rb, which in turn gets its values from config/application.yml. So check that both of these are as expected. Perhaps instrument application.rb to check that it’s being set to what you expect within the delayed job process. Also check the value of config.i18n.default_locale right before the email is rendered.
Hopefully something here will give a clue as to what’s happening.
We need to have the following lines in config/application.rb: config.i18n.default_locale = ENV["LOCALE"] I18n.locale = config.i18n.locale = config.i18n.default_locale