translate / virtaal

Easy-to-use and powerful offline translation tool
https://virtaal.translatehouse.org
GNU General Public License v2.0
300 stars 58 forks source link

Translation memory does not function #3244

Open yaoguai opened 8 years ago

yaoguai commented 8 years ago

Running Debian GNU/Linux 8, Virtaal 0.7.1. The translation memory does not seem to function in any way. My current settings:

This should work properly then. So I begin Virtaal with debug and logging modes both enabled:

$ virtaal --debug -l /tmp/log.txt 0439.po

I see:

  DEBUG tmdb.init_fulltext:134: fts3 supported
  DEBUG tmdb.init_fulltext:147: fulltext table already exists
  DEBUG tmdb.init_fulltext:167: created fulltext triggers
  DEBUG tmdb.preload_db:189: tmdb has 20 records
   INFO wsgi.launch_server:31: Starting CherryPy server, listening on port 55555

I edit the file, adding a few lines that were not previously translated. I hit "save," and then exit the program. I check the SQLite database. It still has only 20 records. I start Virtaal again, and see "tmdb" has 20 records. Nothing has changed, none of the segments were saved in the local TM.

I look for the log file. Apparently the log file was not created either. I would think with a flag like "--debug", some information would be given about saving the file or updating the TM database, but absolutely nothing is shown. The only output shown after program initialization is some gobject error:

  gobject.source_remove(self._delay_id)
/usr/lib/python2.7/dist-packages/virtaal/plugins/tm/tmcontroller.py:194: Warning: Source ID 1266
was not found when attempting to remove it

As it is now, I do not see any way to use the TM. I have tried deleting my entire "$HOME/.virtaal" directory, and this resets all the settings, but the same problem exists after that as well. The TM does not update and also does not give any suggestions. Is there some setting I am missing?

kwenzig commented 8 years ago

Did you change the state to a higher level, e.g. "translated"?

yaoguai commented 8 years ago

No, the translation state is still at "untranslated."

kwenzig commented 8 years ago

As far as I know, the state for an fragment needs to be "translated" (at least more than "untranslated") in order to find its way into the translation memory.

yaoguai commented 8 years ago

No, I meant that the untranslated segments are marked untranslated.

When segments have been translated and marked as translated, when saving the file, no new records are added to the TMDB.

kwenzig commented 8 years ago

I had such issues too. If you want me to have a look at your file, post it here. I'm using Windows at work and Ubuntu at home.

friedelwolff commented 8 years ago

I can't think of an obvious problem here. If it is possible to upload the file, maybe someone can see something strange. All units in the "translated" state should be imported in the TM. Is the language combination in the bottom right of the window correct? Maybe Virtaal is doing nothing because it is set to English -> English?

dwaynebailey commented 8 years ago

@friedelwolff I fear this is related to the install problem reported in #3245

yaoguai commented 8 years ago

The file itself is nothing special, and the status of each item is correct. The language pair is correct (Literary Chinese to English). The problem seems to come in two parts: (1) Translated segments are not being added to the translation memory database. (2) Even when the segments do exist in the database, no suggestions are given at all. It is almost like the translation memory does not exist at all.

I have deleted "$HOME/.virtaal" numerous times to wipe out past settings and try over. Selecting a new text, and setting up the language pair (Literary Chinese, to English), new segments are not being added into the database. For example, translating 20 lines and then hitting "save," those lines should be inserted into the database. However, nothing is actually saved.

$ echo 'select count(1) from targets;' | sqlite3 ~/.virtaal/tm.db
0

I have overridden the default importing behavior so the imported package will be correct. I added a shell script called "run.sh" which fixes the PYTHONPATH so the executable will import from the correct location.

#!/bin/sh
cd $(dirname "$0") || exit 1
PYTHONPATH=. ./bin/virtaal --debug

I have been using Lokalize recently instead because Virtaal is not allowing me to use TM.