# -*- coding: utf-8 -*-
import os,sys
import time
import Lokalize
import Editor

def lookup():
    if not Editor.isValid(): return

    word=Editor.selectionInTarget()
    if not word: word=Editor.selectionInSource()
    if not word: return

    os.system("kfmclient newTab 'http://translate.google.lt/translate_t?prev=hp&hl=lt&js=y&text=%s'" % word)

lookup()
