예제 #1
0
파일: extract.py 프로젝트: TroJan/fjord
def create_pounit(filename, lineno, message, comments):
    unit = po.pounit(encoding="UTF-8")
    if isinstance(message, tuple):
        _, s = split_context(message[0])
        c, p = split_context(message[1])
        unit.setsource([s, p])
        # Workaround for http://bugs.locamotion.org/show_bug.cgi?id=1385
        unit.target = [u"", u""]
    else:
        c, m = split_context(message)
        unit.setsource(m)
    if c:
        unit.msgctxt = ['"%s"' % c]
    if comments:
        for comment in comments:
            unit.addnote(comment, "developer")

    unit.addlocation("%s:%s" % (filename, lineno))
    return unit
예제 #2
0
파일: extract.py 프로젝트: prabushi/fjord
def create_pounit(filename, lineno, message, comments):
    unit = po.pounit(encoding='UTF-8')
    context, msgid = split_context(message)
    unit.setsource(msgid)
    if context:
        unit.msgctxt = ['"%s"' % context]
    for comment in comments:
        unit.addnote(comment, 'developer')

    unit.addlocation('%s:%s' % (filename, lineno))
    return unit
예제 #3
0
def create_pounit(filename, lineno, message, comments):
    unit = po.pounit(encoding='UTF-8')
    context, msgid = split_context(message)
    unit.setsource(msgid)
    if context:
        unit.msgctxt = ['"%s"' % context]
    for comment in comments:
        unit.addnote(comment, 'developer')

    unit.addlocation('%s:%s' % (filename, lineno))
    return unit