@ -329,23 +348,32 @@ class ApplicationController < BaseController
# log it
logger.info"Missing translation found for: #{key}"
# send and email if this is production
begin
UserMailer.send_mail(:error_report)do
[
"A missing translation found in #{Rails.env}",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str||'nil'}</blockquote>",
exception.to_s,
nil,
request,
params,
current_user,
Time.now.strftime("%d/%m/%Y %H:%M")
]
endifRails.env.preview?||Rails.env.production?
rescueException=>exception2
logger.infoexception2.to_s
logger.infoexception2.backtrace.join("\n")
# send an email if this is production
ifRails.env.preview?||Rails.env.production?
begin
requestHash={
'remote_ip'=>arg.remote_ip,
'uuid'=>arg.uuid,
'original_url'=>arg.original_url,
'env'=>Hash.new
}
request.env.eachdo|key,value|
requestHash['env'][key.to_s]=value.to_s
end
UserMailer.error_report(
"A missing translation found in #{Rails.env}",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str||'nil'}</blockquote>",
exception.to_s,
nil,
requestHash,
params,
current_user.id,
Time.now.strftime("%d/%m/%Y %H:%M")
).deliver_later!
rescueException=>exception2
logger.infoexception2.to_s
logger.infoexception2.backtrace.join("\n")
end
end
end
@ -608,6 +636,6 @@ class ApplicationController < BaseController
# send the confirmation email and make sure it get sent as quickly as possible