c3po/converters/po_csv.py
def _write_entries(po_files, languages, msgid, msgstrs, metadata, comment):
    """
    Write msgstr for every language with all needed metadata and comment.
    Metadata are parser from string into dict, so read them only from gdocs.
    """
    start = re.compile(r'^[\s]+')
    end = re.compile(r'[\s]+$')
    for i, lang in enumerate(languages):
        meta = ast.literal_eval(metadata)
        entry = polib.POEntry(**meta)
        entry.tcomment = comment
        entry.msgid = msgid
        if msgstrs[i]:
            start_ws = start.search(msgid)
            end_ws = end.search(msgid)
            entry.msgstr = str(start_ws.group() if start_ws else '') + \
                unicode(msgstrs[i].strip()) + \
                str(end_ws.group() if end_ws else '')
        else:
            entry.msgstr = ''
        po_files[lang].append(entry)
def _write_entries(po_files, languages, msgid, msgstrs, metadata, comment):
    start = re.compile(r'^[\s]+')
    end = re.compile(r'[\s]+$')
    for i, lang in enumerate(languages):
        meta = ast.literal_eval(metadata)
        entry = polib.POEntry(**meta)
        entry.tcomment = comment
        entry.msgid = msgid
        if msgstrs[i]:
            start_ws = start.search(msgid)
            end_ws = end.search(msgid)
            entry.msgstr = str(start_ws.group() if start_ws else '') + \
                unicode(msgstrs[i].strip()) + \
                str(end_ws.group() if end_ws else '')
        else:
            entry.msgstr = ''
        po_files[lang].append(entry)
def _write_entries ( po_files , languages , msgid , msgstrs , metadata , comment ) : start = re . compile ( r'^[\s]+' ) end = re . compile ( r'[\s]+$' ) for i , lang in enumerate ( languages ) : meta = ast . literal_eval ( metadata ) entry = polib . POEntry ( * * meta ) entry . tcomment = comment entry . msgid = msgid if msgstrs [ i ] : start_ws = start . search ( msgid ) end_ws = end . search ( msgid ) entry . msgstr = str ( start_ws . group ( ) if start_ws else '' ) + unicode ( msgstrs [ i ] . strip ( ) ) + str ( end_ws . group ( ) if end_ws else '' ) else : entry . msgstr = '' po_files [ lang ] . append ( entry )
Write msgstr for every language with all needed metadata and comment.
    Metadata are parser from string into dict, so read them only from gdocs.
Write msgstr for every language with all needed metadata and comment . Metadata are parser from string into dict so read them only from gdocs .