Add javascript translation escape

Small changes to prevent JavaScript errors.