c3po/converters/po_ods.py
def _write_trans_into_ods(ods, languages, locale_root,
                          po_files_path, po_filename, start_row):
    """
    Write translations from po files into ods one file.
    Assumes a directory structure:
    <locale_root>/<lang>/<po_files_path>/<filename>.
    """
    ods.content.getSheet(0)
    for i, lang in enumerate(languages[1:]):
        lang_po_path = os.path.join(locale_root, lang,
                                    po_files_path, po_filename)
        if os.path.exists(lang_po_path):
            po_file = polib.pofile(lang_po_path)
            for j, entry in enumerate(po_file):
                # start from 4th column, 1st row
                row = j+start_row
                ods.content.getCell(i+4, row).stringValue(
                    _escape_apostrophe(entry.msgstr))
                if i % 2 == 1:
                    ods.content.getCell(i+4, row).setCellColor(
                        settings.ODD_COLUMN_BG_COLOR)
                else:
                    ods.content.getCell(i+4, row).setCellColor(
                        settings.EVEN_COLUMN_BG_COLOR)
def _write_trans_into_ods(ods, languages, locale_root,
                          po_files_path, po_filename, start_row):
    """
    Write translations from po files into ods one file.
    Assumes a directory structure:
    <locale_root>/<lang>/<po_files_path>/<filename>.
    """
    ods.content.getSheet(0)
    for i, lang in enumerate(languages[1:]):
        lang_po_path = os.path.join(locale_root, lang,
                                    po_files_path, po_filename)
        if os.path.exists(lang_po_path):
            po_file = polib.pofile(lang_po_path)
            for j, entry in enumerate(po_file):
                # start from 4th column, 1st row
                row = j+start_row
                ods.content.getCell(i+4, row).stringValue(
                    _escape_apostrophe(entry.msgstr))
                if i % 2 == 1:
                    ods.content.getCell(i+4, row).setCellColor(
                        settings.ODD_COLUMN_BG_COLOR)
                else:
                    ods.content.getCell(i+4, row).setCellColor(
                        settings.EVEN_COLUMN_BG_COLOR)
Write translations from po files into ods one file.
    Assumes a directory structure:
    <locale_root>/<lang>/<po_files_path>/<filename>.