コード例 #1
0
ファイル: views.py プロジェクト: tobbi/kitsune
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.LANGUAGE_CODE == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse("dashboards.contributors"))
    locales = Locale.objects.filter(locale=request.LANGUAGE_CODE)
    if locales:
        permission = user_can_announce(request.user, locales[0])
    else:
        permission = False

    product = _get_product(request)

    data = {"overview_rows": overview_rows(request.LANGUAGE_CODE, product=product), "user_can_announce": permission}
    return render_readouts(request, L10N_READOUTS, "localization.html", extra_data=data, product=product)
コード例 #2
0
def localization(request):
    """Render aggregate data about articles in a non-default locale."""
    if request.LANGUAGE_CODE == settings.WIKI_DEFAULT_LANGUAGE:
        return HttpResponseRedirect(reverse("dashboards.contributors"))
    locales = Locale.objects.filter(locale=request.LANGUAGE_CODE)
    if locales:
        permission = user_can_announce(request.user, locales[0])
    else:
        permission = False

    product = _get_product(request)

    data = {
        "overview_rows": l10n_overview_rows(request.LANGUAGE_CODE, product=product),
        "user_can_announce": permission,
    }
    return render_readouts(
        request, L10N_READOUTS, "localization.html", extra_data=data, product=product
    )