def about(request): """ Shows about page with version information. """ context = {} totals = Profile.objects.aggregate( Sum('translated'), Sum('suggested'), Count('id') ) total_strings = 0 total_words = 0 for project in SubProject.objects.iterator(): try: translation = project.translation_set.all()[0] total_strings += translation.total total_words += translation.total_words except (IndexError, Translation.DoesNotExist): pass context['title'] = _('About Weblate') context['total_translations'] = totals['translated__sum'] context['total_suggestions'] = totals['suggested__sum'] context['total_users'] = totals['id__count'] context['total_strings'] = total_strings context['total_words'] = total_words context['total_languages'] = Language.objects.filter( translation__total__gt=0 ).distinct().count() context['total_checks'] = Check.objects.count() context['ignored_checks'] = Check.objects.filter(ignore=True).count() context['versions'] = get_versions() + get_optional_versions() return render( request, 'about.html', context )
def get_versions_list(): """Return list with version information summary.""" return ( [('Weblate', '', GIT_VERSION)] + get_versions() + get_optional_versions() )
def about(request): """ Shows about page with version information. """ context = {} totals = Profile.objects.aggregate(Sum('translated'), Sum('suggested'), Count('id')) total_strings = [] total_words = [] for project in SubProject.objects.iterator(): try: translation = project.translation_set.all()[0] total_strings.append(translation.total) total_words.append(translation.total_words) except IndexError: pass context['title'] = _('About Weblate') context['total_translations'] = totals['translated__sum'] context['total_suggestions'] = totals['suggested__sum'] context['total_users'] = totals['id__count'] context['total_strings'] = sum(total_strings) context['total_words'] = sum(total_words) context['total_languages'] = Language.objects.filter( translation__total__gt=0).distinct().count() context['total_checks'] = Check.objects.count() context['ignored_checks'] = Check.objects.filter(ignore=True).count() context['versions'] = get_versions() + get_optional_versions() return render(request, 'about.html', context)
def about(request): """Show about page with version information.""" return render( request, 'about.html', { 'title': _('About Weblate'), 'versions': get_versions() + get_optional_versions(), 'allow_index': True, })
def get_versions_string(): """ Returns string with version information summary. """ result = [" * Weblate %s" % GIT_VERSION] for version in get_versions() + get_optional_versions(): result.append(" * %s %s" % (version[0], version[2])) return "\n".join(result)
def about(request): """ Shows about page with version information. """ context = {} context['title'] = _('About Weblate') context['versions'] = get_versions() + get_optional_versions() return render(request, 'about.html', context)
def get_versions_string(): ''' Returns string with version information summary. ''' result = [' * Weblate %s' % GIT_VERSION] for version in get_versions() + get_optional_versions(): result.append(' * %s %s' % ( version[0], version[2], )) return '\n'.join(result)
def about(request): """Show about page with version information.""" return render( request, 'about.html', { 'title': _('About Weblate'), 'versions': get_versions() + get_optional_versions(), 'allow_index': True, } )
def about(request): """ Shows about page with version information. """ context = {} context['title'] = _('About Weblate') context['versions'] = get_versions() + get_optional_versions() return render( request, 'about.html', context )
def get_versions_string(): ''' Returns string with version information summary. ''' result = [' * Weblate %s' % GIT_VERSION] for version in get_versions() + get_optional_versions(): result.append( ' * %s %s' % ( version[0], version[2], ) ) return '\n'.join(result)
def get_versions_list(): """ Returns list with version information summary. """ return [("Weblate", "", GIT_VERSION)] + get_versions() + get_optional_versions()