Exemple #1
0
 def translateButtonClicked(self):
     srclan = langs[short_name[self.sourceLangComboBox.currentText()]]
     text = self.sourceTextEdit.toPlainText().strip()
     first = 'ip'
     if self.targetLangComboBox.currentText() == "*caseframe":
         tr = text_to_interlingua(text, first, srclan)
         s = ''
         for item in tr:
             s += interlingua_to_str(item) + '\n' + '-'*50 + '\n'
         self.targetTextEdit.setText(s)
     else:
         trglan = langs[short_name[self.targetLangComboBox.currentText()]]
         tr = translate(text, first, srclan, [trglan])
         self.targetTextEdit.setText(friendly_output(tr[0]))
Exemple #2
0
 def trans(self):
     srclan = langs[short_name[self.source_combo_box.get()]]
     text = self.source_text.get('1.0', 'end').strip()
     first = 'ip'
     self.target_text.config(state=NORMAL)
     self.target_text.delete('1.0', 'end')
     if self.target_combo_box.get() == "*caseframe":
         tr = text_to_interlingua(text, first, srclan)
         s = ''
         for item in tr:
             s += interlingua_to_str(item) + '\n' + '-'*50 + '\n'
         self.target_text.insert('end', s)
     else:
         trglan = langs[short_name[self.target_combo_box.get()]]
         tr = translate(text, first, srclan, [trglan])
         self.target_text.insert('end', friendly_output(tr[0]))
     self.target_text.config(state=DISABLED)