@ -329,25 +344,34 @@ class ApplicationController < BaseController
# log it
logger.info"Missing translation found for: #{key}"
# send and email if this is production
# send an email if this is production
ifRails.env.preview?||Rails.env.production?
begin
UserMailer.send_mail(:error_report)do
[
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,
request,
requestHash,
params,
current_user,
current_user.id,
Time.now.strftime("%d/%m/%Y %H:%M")
]
endifRails.env.preview?||Rails.env.production?
).deliver_later!
rescueException=>exception2
logger.infoexception2.to_s
logger.infoexception2.backtrace.join("\n")
end
end
end
defset_success_message(message,is_ajax=false)
ifis_ajax
@ -608,6 +632,6 @@ class ApplicationController < BaseController
# send the confirmation email and make sure it get sent as quickly as possible