A bit more detective work and I find that line 4822 is the closing bracket on the checkLang() function
function checkLang() {
global $_lang;
$eng = array();
$eng[\’forgot_your_password\’] = \’Forgot your password?\’;
$eng[\’account_email\’] = \’Account email\’;
$eng[\’send\’] = \’Send\’;
$eng[\’password_change_request\’] = \’Password change request\’;
$eng[\’forgot_password_email_intro\’] = \’A request has been made to change the password on your account.\’;
$eng[\’forgot_password_email_link\’] = \’Click here to complete the process.\’;
$eng[\’forgot_password_email_instructions\’] = \’From there you will be able to change your password from the My Account menu.\’;
$eng[\’forgot_password_email_fine_print\’] = \’* The URL above will expire once you change your password or after today.\’;
$eng[\’error_sending_email\’] = \’Error sending email\’;
$eng[\’could_not_find_user\’] = \’Could not find user\’;
$eng[\’user_doesnt_exist\’] = \’User does not exist\’;
$eng[\’email_sent\’] = \’Email sent\’;
foreach($eng as $key=>$value) {
if(empty($_lang[$key])) { $_lang[$key] = $value; }
}
}
I removed all the code from within the function and ModX worked again.
Then I pasted it back in and upload and it still works.
Go figure.
I am still curious about what might have happened if anyone has an idea, it stopped me working for about an hour (which might not be a bad thing really

)