@ -329,25 +348,34 @@ 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
ifRails.env.preview?||Rails.env.production?
begin
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}",
"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>",
"<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,
exception.to_s,
nil,
nil,
request,
requestHash,
params,
params,
current_user,
current_user.id,
Time.now.strftime("%d/%m/%Y %H:%M")
Time.now.strftime("%d/%m/%Y %H:%M")
]
).deliver_later!
endifRails.env.preview?||Rails.env.production?
rescueException=>exception2
rescueException=>exception2
logger.infoexception2.to_s
logger.infoexception2.to_s
logger.infoexception2.backtrace.join("\n")
logger.infoexception2.backtrace.join("\n")
end
end
end
end
end
defset_success_message(message,is_ajax=false)
defset_success_message(message,is_ajax=false)
ifis_ajax
ifis_ajax
@ -608,6 +636,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