[damned-lies] Fixed word stats computing
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Fixed word stats computing
- Date: Mon, 26 Mar 2018 10:07:12 +0000 (UTC)
commit 1b0fc68adb1af6385fc8acb65ff904a042cbf185
Author: Claude Paroz <claude 2xlibre net>
Date: Mon Mar 26 12:06:17 2018 +0200
Fixed word stats computing
Fixes bug #794684
stats/tests/tests.py | 1 +
stats/utils.py | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/stats/tests/tests.py b/stats/tests/tests.py
index d2e594c..be8d39b 100644
--- a/stats/tests/tests.py
+++ b/stats/tests/tests.py
@@ -136,6 +136,7 @@ class ModuleTestCase(TestCase):
self.branch.update_stats(force=True)
fr_po_stat = Statistics.objects.get(branch=self.branch, domain__name='po', language__locale='fr')
self.assertEqual(fr_po_stat.translated(), 44)
+ self.assertEqual(fr_po_stat.translated_words(), 131)
pot_doc_stat = Statistics.objects.get(branch=self.branch, domain__name='help', language=None)
self.assertEqual(len(pot_doc_stat.full_po.figures), 2)
fr_doc_stat = Statistics.objects.get(branch=self.branch, domain__name='help', language__locale='fr')
diff --git a/stats/utils.py b/stats/utils.py
index 61e6457..1947240 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -482,7 +482,7 @@ def po_file_stats(pofile, msgfmt_checks=True):
input_file = str(pofile)
if has_toolkit:
- status = pocount.calcstats_old(pofile)
+ status = pocount.calcstats_old(input_file)
if status:
res['fuzzy_words'] = status['fuzzysourcewords']
res['translated_words'] = status['translatedsourcewords']
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]