I noticed the translation memory was not working for me, and I was translating a file (into Galician, gl) where there were a lot of strings with just one different word, so I decided to manually add the current file and another one to the translation memory. Lokalize crashed right away. I decided to try to reproduce the issue, and I failed. But I will provide the steps that I followed, which wouldn’t get me a working translation memory widget. Reproducible: Always Steps to Reproduce: First, I created a script to remove the Lokalize settings files before running the application, to ensure this is not a settings issue: #!/bin/bash rm $HOME/.kde4/share/config/lokalizerc rm -r $HOME/.kde4/share/apps/lokalize lokalize When I run it, I get the following output: [gallaecio@afonsox aqueronte]$ ./run-clean-lokalize.sh 281 282 283 284 Enchant dict for "gl" 0x2535230 Enchant dict for "gl" 0x2535230 lokalize(19471) LokalizeMainWindow::setupActions: finished 13 Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" loadProjectScripts() 1111 "/" loadProjectScripts() 333 loadProjectScripts() 444 loadProjectScripts() 555 loadProjectScripts() 666 accessing tm db config true use cache: true setConfig "/home/gallaecio/.kde4/share/apps/lokalize/default.db" setting tm db config 1: true setting tm db config 2: true setting tm db config 3: true lokalize(19471)/lokalize (TM) TM::OpenDBJob::run: db "default" opened 1771 "gl" Then, I click on “Open Project”, and I select a project with the following content: [General] AltDir=../pt BranchDir=../../../branches/stable/l10n-kde4/gl LangCode=gl MailingList=proxecto@trasno.net PotBaseDir=../templates/ ProjectID=kde-gl TargetLangCode=gl The summary page starts to fill up with statistics, and at this point, the output has the following additional lines: lokalize(19471) KSambaSharePrivate::findSmbConf: KSambaShare: Could not find smb.conf! glossary loaded in 0 glossary loaded in 129 loadProjectScripts() 1111 "/home/gallaecio/proxectos/tradución/kde/trunk/gl" loadProjectScripts() 222 loadProjectScripts() 333 Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" lokalize(19471) ProjectScriptingPlugin::~ProjectScriptingPlugin: ("apertium.rc", "scripts.rc") lokalize(19471) ProjectScriptingPlugin::~ProjectScriptingPlugin: "apertium.rc" true loadProjectScripts() 444 Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" Kross: "Action::setInterpreter: interpreter not found: python" loadProjectScripts() 555 loadProjectScripts() 666 Kross: "No such interpreter 'python'" Kross: "Error error=Non existe o intérprete «python» lineno=-1 trace= " accessing tm db config true use cache: true setConfig "/home/gallaecio/.kde4/share/apps/lokalize/kde-gl.db" setting tm db config 1: true setting tm db config 2: true setting tm db config 3: true lokalize(19471)/lokalize (TM) TM::OpenDBJob::run: db "kde-gl" opened 2614 "gl" Then I open the file at “docmessages/extragear-utils/krecipes.po” from that Summary. The following output appears in the console: Enchant dict for "gl" 0x2535230 Enchant dict for "gl" 0x2535230 lokalize(19471) Catalog::loadFromUrl: file opened in 42 Enchant dict for "gl" 0x2535230 lokalize(19471): No language dictionaries for the language : "en_US" Enchant dict for "gl" 0x2535230 Enchant dict for "gl_ES" 0x643e750 lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showmsgiddiff_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showmergeview_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showmergeviewsecondary_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showcatalogtreeview_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showmsgctxt_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showtmqueryview_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showglossaryview_action" with KXMLGUIFactory! lokalize(19471)/kdeui (kdelibs): Attempt to use QAction "showbinunitsview_action" with KXMLGUIFactory! The window has, in the bottom area, both the Translation Memory and the Glossary widgets. However, when I right click to select new widgets (I usually work with a Primary Synchronization), I notice the Translation Memory is actually unmarked. See the screenshot at http://image.bayimg.com/caclnaaec.jpg . I mark the checkbox to check — nothing happens —, I unmark it — the widget disapears, as expected —, then I mark it back — and the widget reappears, as expected —. The console output has not changed one bit at this point. I go back to the Project Summary, I right click the file I’ve opened, and I select Add to Translation Memory. Then I go back to the file tab, and I browse the translation units, but the Memory widgets stays empty. I repeat these steps once, just in case, with no change. The output has the following new lines: lokalize(19471)/lokalize (TM) TM::OpenDBJob::run: db "kde-gl" opened 0 "gl" lokalize(19471) TM::RecursiveScanJob::scanJobFinished: finished in 37 msecs lokalize(19471)/lokalize (TM) TM::ScanJob::~ScanJob: KUrl("file:///home/gallaecio/proxectos/tradución/kde/trunk/gl/docmessages/extragear-utils/krecipes.po") lokalize(19471)/lokalize (TM) TM::OpenDBJob::run: db "kde-gl" opened 0 "gl" lokalize(19471) TM::RecursiveScanJob::scanJobFinished: finished in 1 msecs lokalize(19471)/lokalize (TM) TM::ScanJob::~ScanJob: KUrl("file:///home/gallaecio/proxectos/tradución/kde/trunk/gl/docmessages/extragear-utils/krecipes.po") Then I go to “Settings → Lokalize Settings…”, then to “Translation Memory”, and mark the first and last checkboxed, which were unmarked by default. As a result, the three checkboxes in that settings page are marked, and the number of results is set to 7. Then I click OK. No change in the output. I browse again the translation units, and the list in the translation memory is still empty. I tried to open and reopen the file, open a different file, etc. No-matter-what, the translation memory widget won’t provide a single result. Also, after closing a tab and opening again the file — or a new file —, the right-click menu shows the Memory again unmarked, even when it is actually displayed in the application window. Actual Results: The translation memory should show results. Expected Results: It does not.
"I decided to try to reproduce the issue, and I failed." So, to be clear. Do you see the translation memory suggestions or not? If you don't see them, then please attach to this report your $HOME/.kde4/share/apps/lokalize folder, your project folder and specify the files which you have problems with. (please compress the data to save bugs.kde.org storage space)
Created attachment 73899 [details] Requested files. Sorry, the first paragraph used to say that the application crashed, which was what I tried to reproduce in the first place. When I tried to reproduce the crash, I could not , but the translation memory would still not show up, so I modified the report to complaint about that. I attached the “lokalize” folder, along with a “gl” folder containing the Lokalize project file I used plus a “.po” file to reproduce the issue. I have just realized that, opening the file separatedly (not from the project summary in Lokalize), I do get the translation memories showing up. That is: - Click on gl/docmessages/extragear-utils/krecipes.po → Works: open in Lokalize and provides translation memory entries when browsing the translation units. - Open Lokalize, go to “Project → Open Project”, select the gl/lokalize.ktp file, click docmessages/extragear-utils/krecipes.po on the project summary in Lokalize → It does not work: browsing the translation units, the translation memory widget stays empty.
i think the problem was that sometimes you had two-letter target language code, and sometimes 4-letter code. I have made lokalize a bit more robust: now if the target language of the file being edited doesn't match the default TM used then new TM is created with correct target language
I’ve not suffered this issue recently, so I think we can assume your changes fixed it. Thank you!