(msgs, checker_messages, email, app_name, result_wb)
:param msgs: messages for app translation discrepancies
    :param checker_messages: messages for issues found by translation checker
    :param email: email to
    :param app_name: name of the application
    :param result_wb: result wb of translation checker to attach with the email
:param msgs: messages for app translation discrepancies
    :param checker_messages: messages for issues found by translation checker
    :param email: email to
    :param app_name: name of the application
    :param result_wb: result wb of translation checker to attach with the email
: param msgs : messages for app translation discrepancies : param checker_messages : messages for issues found by translation checker : param email : email to : param app_name : name of the application : param result_wb : result wb of translation checker to attach with the email
def _email_app_translations_discrepancies(msgs, checker_messages, email, app_name, result_wb):
    """
    :param msgs: messages for app translation discrepancies
    :param checker_messages: messages for issues found by translation checker
    :param email: email to
    :param app_name: name of the application
    :param result_wb: result wb of translation checker to attach with the email
    """
    def form_email_content(msgs, checker_messages):
        if msgs:
            html_file_content = ghdiff.default_css
            for sheet_name, msg in msgs.items():
                html_file_content += "<strong>{}</strong>".format(sheet_name) + msg
            text_content = _("Hi, PFA file for discrepancies found for app translations.") + "\n"
        else:
            html_file_content = None
            text_content = _("Hi, No discrepancies found for app translations.") + "\n"
        if checker_messages:
            text_content += _("Issues found with the workbook are as follows :") + "\n"
            text_content += '\n'.join([_(msg) for msg in checker_messages])
        else:
            text_content += _("No issues found with the workbook.")
        return html_file_content, text_content

    def attachment(title, content, mimetype='text/html'):
        return {'title': title, 'file_obj': content, 'mimetype': mimetype}

    subject = _("App Translations Discrepancies for {}").format(app_name)
    html_file_content, text_content = form_email_content(msgs, checker_messages)
    attachments = []
    if html_file_content:
        attachments.append(attachment("{} Discrepancies.html".format(app_name), io.StringIO(html_file_content)))
    if result_wb:
        attachments.append(attachment("{} TranslationChecker.xlsx".format(app_name),
                           io.BytesIO(read_workbook_content_as_file(result_wb)), result_wb.mime_type))

    send_html_email_async.delay(subject, email, linebreaksbr(text_content), file_attachments=attachments)
def _email_app_translations_discrepancies ( msgs , checker_messages , email , app_name , result_wb ) : def form_email_content ( msgs , checker_messages ) : if msgs : html_file_content = ghdiff . default_css for sheet_name , msg in msgs . items ( ) : html_file_content += "<strong>{}</strong>" . format ( sheet_name ) + msg text_content = _ ( "Hi, PFA file for discrepancies found for app translations." ) + "\n" else : html_file_content = None text_content = _ ( "Hi, No discrepancies found for app translations." ) + "\n" if checker_messages : text_content += _ ( "Issues found with the workbook are as follows :" ) + "\n" text_content += '\n' . join ( [ _ ( msg ) for msg in checker_messages ] ) else : text_content += _ ( "No issues found with the workbook." ) return html_file_content , text_content def attachment ( title , content , mimetype = 'text/html' ) : return { 'title' : title , 'file_obj' : content , 'mimetype' : mimetype } subject = _ ( "App Translations Discrepancies for {}" ) . format ( app_name ) html_file_content , text_content = form_email_content ( msgs , checker_messages ) attachments = [ ] if html_file_content : attachments . append ( attachment ( "{} Discrepancies.html" . format ( app_name ) , io . StringIO ( html_file_content ) ) ) if result_wb : attachments . append ( attachment ( "{} TranslationChecker.xlsx" . format ( app_name ) , io . BytesIO ( read_workbook_content_as_file ( result_wb ) ) , result_wb . mime_type ) ) send_html_email_async . delay ( subject , email , linebreaksbr ( text_content ) , file_attachments = attachments )