Beispiel #1
0
 def _trans2(self):
     lan = self._cmd.split('2')
     g = GoogleDict(self._content, lan[0], lan[1])
     data = g.reply()
     if data:
         return data['reply']
     return 'Not Found'
Beispiel #2
0
 def _google(self):
     g = GoogleDict(self._content)
     lan = g.detect()
     condition = lan == config.LANGUAGE
     if 'zh' == config.LANGUAGE:
         condition = lan in ('zh-CN', 'zh-TW')
     if condition:
         g = GoogleDict(self._content, lan, 'en')
     else:
         g = GoogleDict(self._content, lan, config.LANGUAGE)
     data = g.reply()
     if data:
         return data['reply']
     return 'Not Found'