Bug 192927

Summary: lokalize stats not shown for some files in project view
Product: [Applications] lokalize Reporter: Viesturs Zarins <viesturs.zarins>
Component: generalAssignee: Nick Shaforostoff <shafff>
Status: RESOLVED FIXED    
Severity: normal CC: franklin, karl, lueck, qiilaq69, stefan.asserhall
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: test file.
patch for POT file stats
Temporary fix for the large files problem

Description Viesturs Zarins 2009-05-16 20:29:35 UTC
Version:            (using KDE 4.2.85)
OS:                Linux
Installed from:    Unlisted Binary Package

The problem has been there from KBabel times.

There are some files that do not show correct stats in project tree, but when opened have the correct stats.

For example desktop-kdebase.po in Latvian translations, trunk ( http://websvn.kde.org/trunk/l10n-kde4/lv/messages/kdebase/desktop_kdebase.po ).

The problem is - there are much more such files in current trunk, over 10%.

Maybe Lokalize can use it's internal parser for the files where KFileMetaInfo returns all zeros?
Comment 1 Nick Shaforostoff 2009-05-16 20:49:55 UTC
strigi analyzer can use gettext c parser. i added this to my plan.
Comment 2 Viesturs Zarins 2009-05-17 18:46:05 UTC
Created attachment 33772 [details]
test file.

Looks like files with commented lines are affected. See file.
Comment 3 Nick Shaforostoff 2009-05-25 01:30:50 UTC
the problem should be solved by now after recent commits to strigi-analyzer.
if its not, please reopen this bug.

(you can try 'xmlindexer file.po | less' to see immediate analyzer output)
Comment 4 Viesturs Zarins 2009-05-25 08:09:10 UTC
Nice, I will try this out.
Comment 5 Viesturs Zarins 2009-05-25 19:21:54 UTC
Created attachment 33996 [details]
patch for POT file stats

A lot better how :).

There is still problem with POT files - indexer report their translated count as -1. Added patch to fix the problem.

Did some manual edits on the patch file, I hope it will apply.
Comment 6 Viesturs Zarins 2009-05-25 20:18:39 UTC
Noticed one more problem. 
KFileMetaInfo would not read files longer than exactly  104 Kib, for example kdebase/desktop_kdebase.po

xmlindexer works fine on them, but KFileMetaInfo fails. Maybe you have a clue how to circumvent this?
Comment 8 Nick Shaforostoff 2009-05-26 02:06:35 UTC
SVN commit 972923 by shaforo:

CCBUG: 192927
correctly handle templates



 M  +6 -2      polineanalyzer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=972923
Comment 9 Nick Shaforostoff 2009-05-26 02:09:52 UTC
btw, you might want to come to http://www.aspirationtech.org/events/opentranslation/2009/agenda/overview (I'm gathering things for getting visa right now)
Comment 10 Nick Shaforostoff 2009-05-26 02:22:04 UTC
regarding  large files: a limit value in 
http://lxr.kde.org/source/KDE/kdelibs/kio/kio/predicateproperties.cpp#104
should be adjusted depending on 'what' value of KMetaInfo c'tor.

gonna need some kde-core-devel@ procedures to get this into KDE 4.3...
Comment 11 stefan.asserhall 2009-08-06 10:17:05 UTC
Created attachment 35902 [details]
Temporary fix for the large files problem

Here is a temporary fix that I'm using for the lage files problem, before the real fix is available.
Comment 12 Franklin Weng 2009-08-13 06:02:50 UTC
In the KDE 4.3.0 release this problem exists.

I'm using Mandriva packages.
Comment 13 Franklin Weng 2009-08-14 05:50:07 UTC
Can this bug be fixed soon?  It is even more inconvenient than in KDE 4.2...  :( 
I need to check every unstat file to make sure they needed to be translated or not.
Comment 14 Burkhard Lück 2009-10-02 08:21:48 UTC
(In reply to comment #11)
> Created an attachment (id=35902) [details]
> Temporary fix for the large files problem
> 
> Here is a temporary fix that I'm using for the lage files problem, before the
> real fix is available.

I am using Stefans patch here in trunk + branch, works perfectly. 

This bug should be fixed really soon, all our (german) translators with a lokalize from there distro have this problem.
Comment 15 stefan.asserhall 2009-10-02 19:17:33 UTC
This bug is not really in Lokalize, but in KFileMetaInfo/Strigi. It could be fixed in Lokalize by bypassing KFileMetaInfo, but I don't think that is a good solution. To get it fixed it should be reassigned to Strigi. Could someone with enough karma please do that?
Comment 16 Nick Shaforostoff 2009-11-14 19:14:35 UTC
well i don't have this problem on my machine (standard debian kde 4.3.2 packages, http://patch-tracker.debian.org/package/kde4libs/4:4.3.2-2 shows no kio-related patches), desktop_kdebase.po has corrrect stats
Comment 17 Marek Laane 2009-11-17 05:35:36 UTC
Essentially, https://bugs.kde.org/show_bug.cgi?id=203152 and https://bugs.kde.org/show_bug.cgi?id=214571 are duplicates of this bug.
Comment 18 Nick Shaforostoff 2009-11-20 00:01:38 UTC
*** Bug 203152 has been marked as a duplicate of this bug. ***
Comment 19 Nick Shaforostoff 2009-11-20 00:03:00 UTC
i posted the patch to reviewboard (http://reviewboard.kde.org/r/2215/).
Comment 20 Marek Laane 2009-11-30 15:19:39 UTC
Well, it seems to be correct now (as of KDE 4.3.77) and Lokalize even shows real statistics for the files previously shown as grey, without statistics
Comment 21 Nick Shaforostoff 2009-12-06 23:33:06 UTC
ok, thanks all.