GNOME Bugzilla – Bug 686772
gaupol and apertium
Last modified: 2012-10-24 21:50:43 UTC
Tried to get the apertium extension working in gaupol as described here: http://wiki.apertium.org/wiki/Translating_subtitles and the only result i get was this. Traceback File: usr/share/gaupol/lib/gaupol/gtk/dialogs/preferences.py Line: 282 In: _on_tree_view_selection_changed sensitive = self.manager.has_help(module) File: usr/share/gaupol/lib/gaupol/gtk/extensionman.py Line: 127 In: has_help extension = self._active[module] KeyError: 'apertium' Platform Linux-2.6.32-44-generic-pae-i686-with-Ubuntu-10.04-lucid Versions Gaupol: 0.15.1 Python: 2.6.5 GTK+: 2.20.1 PyGTK: 2.17.0 PyEnchant: 1.5.3 Universal Encoding Detector: 2.0.1
I can't tell what happens from that traceback. You could try starting gaupol from a terminal window and see if there's any error output. But gaupol 0.15.1 is old and the extension system was rather new having been introduced in 0.14. I'd recommend you try gaupol 0.19.2 [1]. The lastest version is 0.20, but that uses some newer libraries and the apertium extension is to my knowledge not yet ported to those. [1] http://download.gna.org/gaupol/0.19/gaupol-0.19.2.tar.gz
output in terminal $ gaupol Traceback (most recent call last):
+ Trace 231086
try: mobj = __import__(module, {}, {}, [])
import aeidon
/usr/share/gaupol/lib/gaupol/gtk/agents/update.py:197: DeprecationWarning: use gtk.Statusbar.remove_message self.statusbar.remove(0, self._message_id) Downloaded gaupol-0.19.2 running straight from the unpacked bin dir. had to point in preferences the right apertium dir. But then, also different errors, and while i do have installed quite some apertium files, no choice of translate from - to what i expected. Thanks!
(In reply to comment #2) > Downloaded gaupol-0.19.2 > running straight from the unpacked bin dir. Don't try run from the bin dir! And you probably even didn't if you used command 'gaupol' instead of './gaupol'. Run from the source top-level directory and use command 'bin/gaupol' or 'python bin/gaupol'. That way python will find the correct aeidon and gaupol packages instead of trying to use your 0.15.1 in /usr.
ok output of first one erik@erik:~/Escritorio/gaupol-0.19.2$ bin/gaupol getopt: opción inválida -- l WARNING: /usr/bin/apertium -l returned 1 ['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)'] getopt: opción inválida -- l WARNING: /usr/bin/apertium -l returned 1 WARNING: cannot translate without a project! ACTIVATED WARNING: /usr/bin/apertium -f html language /tmp/infile.tmp /tmp/outfile.tmp returned 1 Traceback (most recent call last):
+ Trace 231087
self.format(page.project.subtitles)))
fout = open(outfile, "r")
crashed on the missing outfile.tmp and output of the python one: erik@erik:~/Escritorio/gaupol-0.19.2$ python bin/gaupol getopt: opción inválida -- l WARNING: /usr/bin/apertium -l returned 1 ['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)'] getopt: opción inválida -- l WARNING: /usr/bin/apertium -l returned 1 ACTIVATED WARNING: /usr/bin/apertium -f html directory /tmp/infile.tmp /tmp/outfile.tmp returned 1 Traceback (most recent call last):
It always crashes as soon as a double click on one of the options of apertium. tried language, directory. And there comes the crash.
(In reply to comment #4) > WARNING: cannot translate without a project! Seems like you don't have a file open in gaupol. "Now open a subtitle file and click the Apertium menu and Translate" -- http://wiki.apertium.org/wiki/Translating_subtitles
oh yes sorry, that was my second intent, but the other two intents i had a file open. and now again. first of all. I cannot choose input nor output language. Secondly the /tmp/outfile.tmp cannot be created. which is a fatal error. erik@erik:~/Escritorio/gaupol-0.19.2$ python bin/gaupol getopt: opción inválida -- l WARNING: /usr/bin/apertium -l returned 1 ['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)'] ACTIVATED WARNING: /usr/bin/apertium -f html output /tmp/infile.tmp /tmp/outfile.tmp returned 1 Traceback (most recent call last):
+ Trace 231088
(In reply to comment #6) > and now again. first of all. I cannot choose input nor output language. > Secondly the /tmp/outfile.tmp cannot be created. which is a fatal error. This is probably because of > WARNING: /usr/bin/apertium -l returned 1 But I'm not at all familiar with apertium or this extension. I suggest you contact the extension author. gaupol itself seems to me is working fine here.
Ok, thanks!