[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Web search in Lokalize
From:       "Nick Shaforostoff" <shaforostoff () gmail ! com>
Date:       2008-10-03 13:25:19
Message-ID: 758e8e2d0810030625m475d0856u15428416ce2de408 () mail ! gmail ! com
[Download RAW message or body]

On Fri, 03 Oct 2008 13:00:34 +0300, <kde-i18n-doc-request@kde.org> wrote:
> How is the Web search feature in Lokalize supposed to work?
> I couldn?t get it to work at all ?
well, it isn't ;)
I'm evaluating removing that code in favor of pology-based implementation,
which generates auxiliary file to be used via Sync feature in Lokalize

It would look like:

    <import statements, fargs checks>

    cat = Catalog(fargs[0])
    for msg in cat:
        if msg.msgstr[0]=='':
            continue

        time.sleep(5) #5 secs: we are good-behaving persons

        <fill headers, body>

        response, content = http.request(url, 'POST', headers=headers,
body=urllib.urlencode(body))

        <remove accompanying html>

        msg.msgstr[0]=content

    cat.sync(force=True)



BTW translate.google.com rocks
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic