Commit 3f9080d5 authored by Michal Čihař's avatar Michal Čihař

Include word counts in about page (fixes #314)

parent 0b2a0f9a
......@@ -345,9 +345,11 @@ def about(request):
context = {}
totals = Profile.objects.aggregate(Sum('translated'), Sum('suggested'))
total_strings = 0
total_words = 0
for project in SubProject.objects.iterator():
try:
total_strings += project.translation_set.all()[0].total
total_words += project.translation_set.all()[0].total_words
except Translation.DoesNotExist:
pass
context['title'] = _('About Weblate')
......@@ -355,6 +357,7 @@ def about(request):
context['total_suggestions'] = totals['suggested__sum']
context['total_users'] = Profile.objects.count()
context['total_strings'] = total_strings
context['total_words'] = total_words
context['total_languages'] = Language.objects.filter(
translation__total__gt=0
).distinct().count()
......
......@@ -54,6 +54,10 @@
<td>{{ total_strings }}</td>
</tr>
<tr>
<th>{% trans "Words to translate" %}</th>
<td>{{ total_words }}</td>
</tr>
<tr>
<th>{% trans "Used languages" %}</th>
<td>{{ total_languages }}</td>
</tr>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment