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