GNOME Bugzilla – Bug 662454
Incorrect word counts
Last modified: 2012-06-12 18:43:33 UTC
Created attachment 199720 [details] Screenshot of the problem The new word counting feature reports incorrect values for my gnome-help translation. Strings: 98% 2470 35 0 Words: 95% 51252 1195 1287 How can the 0 untranslated strings be 1287 words long? Aside from that, the 1195 words for the number of fuzzy strings is correct.
The problem is that I can not reproduce it locally unfortunately. Any pointers on how to reproduce it would be helpful.
51252 translated plus 1195 fuzzy equals the 52447 total words shown in screen shot for the POT. The persistence of the 1287 in a field that should be zero is inexplicable and apparently not reproducible. As this bug was filed 5 months ago, can you provide another example fo thsi behavior? Or perhaps is was a temporary abberation.
Not reproducible? Sadly it is. Please take a look at http://l10n.gnome.org/languages/hu/gnome-3-4/ui/ and any of the modules, they almost all (those changed recently) show the same symptom: http://l10n.gnome.org/vertimus/empathy/master/po/hu 4332 0 441 http://l10n.gnome.org/vertimus/epiphany/gnome-3-4/po/hu 1757 0 623 etc. And other languages too: http://l10n.gnome.org/vertimus/epiphany/gnome-3-4/po/fr 1757 0 1 http://l10n.gnome.org/vertimus/epiphany/gnome-3-4/po/de 1757 0 623 http://l10n.gnome.org/vertimus/epiphany/gnome-3-4/po/ca 1757 0 3647
Created attachment 213011 [details] a screenshot that shows the problem Hi all, I've attached a screenshot that shows this bug. Please refer to it. It shows: Strings: 100% 1204 0 0 Words: 97% 3812 0 111 I've debugged and determined the cause of the problem. The following diff is a patch: =================================== diff --git a/stats/utils.py b/stats/utils.py index 40b8982..10999a6 100644 --- a/stats/utils.py +++ b/stats/utils.py @@ -333,7 +333,7 @@ def po_file_stats(pofile, msgfmt_checks=True): input_file = pofile if has_toolkit: - status = pocount.calcstats_old(pofile) + status = pocount.calcstats(pofile) res['fuzzy_words'] = status['fuzzysourcewords'] res['translated_words'] = status['translatedsourcewords'] res['untranslated_words'] = status['untranslatedsourcewords'] =================================== You should use calcstats() instead of calcstats_old(). The calcstats_old() function counts obsolete messages as untranslataed. So, the total count of valid words are incorrect. Thank you.
Created attachment 213012 [details] [review] a patch for this bug I've attached the patch. Please review it.
I remember we had problems with calcstats, see http://git.gnome.org/browse/damned-lies/commit/?id=827c8fcfb I can try to temporarily reenable the new calcstats method on l10n.gnome.org, but we might encounter the same issues again.
Here's the traceback I got from using the calcstats method: Traceback (most recent call last):
+ Trace 230141
branch.update_stats(options['force'])
pot_stats = utils.po_file_stats(potfile, msgfmt_checks=False)
status = pocount.calcstats(pofile)
statscache = statsdb.StatsCache()
return make_database(statsfile)
cache.create()
result = f(self, *args, **kwargs)
self.file_totals = FileTotals(self.cur)
translatedtargetwords INTEGER NOT NULL);""")
(In reply to comment #6) > I remember we had problems with calcstats, see > http://git.gnome.org/browse/damned-lies/commit/?id=827c8fcfb > > I can try to temporarily reenable the new calcstats method on l10n.gnome.org, > but we might encounter the same issues again. Hmm, In fact, there is mismatch between string statistics and words statitics. I think it is a problem of the pocount which counts obsolete units. I report that on http://bugs.locamotion.org [1]. [1] http://bugs.locamotion.org/show_bug.cgi?id=2159
New update on this. I asked the sysadmins to apply the patch made by Jiro (and already committed on translation-toolkit) and as of yesterday is already on l10n.gnome.org, see https://bugzilla.gnome.org/show_bug.cgi?id=677587 For some reason the bug is still present. I made quite a few commits yesterday and today and all the translations still counts the obsolete strings on the word counting. Maybe there is another patch that is missing. I will ask the translate-toolkit team to create a new release.
I don't see any confirmation in bug 677587 that the fix has been deployed. The latest toolkit does have this fixed (I verified on some specific files that currently the problem on damned lies), so I'm just wondering if the fix was maybe applied to an unused copy of the toolkit, or maybe not yet deployed.
I confirm (sorry for the delay) that DL is not using the system translate-toolkit but a custom one. I just applied the patch and restarted the app, so now you can check again if this makes any difference.
I can confirm that it seems to work: I just uploaded this translation which shows words at 100%: http://l10n.gnome.org/vertimus/gtksourceview/gnome-3-4/po/ca@valencia Even if the file has obsolete translations: http://l10n.gnome.org/POT/gtksourceview.gnome-3-4/gtksourceview.gnome-3-4.ca@valencia.po Hurray for Jiro!!