Ejemplo n.º 1
0
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 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)
Ejemplo n.º 2
0
def get_versions_list():
    """Return list with version information summary."""
    return (
        [('Weblate', '', GIT_VERSION)] +
        get_versions() +
        get_optional_versions()
    )
Ejemplo n.º 3
0
def about(request):
    """Show about page with version information."""
    context = {}
    context['title'] = _('About Weblate')
    context['versions'] = get_versions() + get_optional_versions()

    return render(request, 'about.html', context)
Ejemplo n.º 4
0
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
    )
Ejemplo n.º 5
0
def get_versions_list():
    """Return list with version information summary."""
    return (
        [('Weblate', '', GIT_VERSION)] +
        get_versions() +
        get_optional_versions()
    )
Ejemplo n.º 6
0
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,
        })
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
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)
Ejemplo n.º 9
0
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,
        }
    )
Ejemplo n.º 10
0
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
    )
Ejemplo n.º 11
0
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)
Ejemplo n.º 12
0
def get_versions_list():
    """
    Returns list with version information summary.
    """
    return [("Weblate", "", GIT_VERSION)] + get_versions() + get_optional_versions()