Projet

Général

Profil

0001-api-add-translation-context-to-statistics-choices-61.patch

Valentin Deniaud, 24 janvier 2022 14:15

Télécharger (1,55 ko)

Voir les différences:

Subject: [PATCH] api: add translation context to statistics choices (#61000)

 chrono/api/views.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
chrono/api/views.py
34 34
from django.utils.timezone import localtime, make_aware, now
35 35
from django.utils.translation import gettext
36 36
from django.utils.translation import gettext_noop as N_
37
from django.utils.translation import pgettext
37 38
from django.utils.translation import ugettext_lazy as _
38 39
from django_filters import rest_framework as filters
39 40
from rest_framework import permissions
......
2417 2418

  
2418 2419
    def get(self, request, *args, **kwargs):
2419 2420
        categories = Category.objects.all()
2420
        category_options = [{'id': '_all', 'label': _('All')}] + [
2421
        category_options = [{'id': '_all', 'label': pgettext('categories', 'All')}] + [
2421 2422
            {'id': x.slug, 'label': x.label} for x in categories
2422 2423
        ]
2423 2424
        agendas = Agenda.objects.all()
2424
        agenda_options = [{'id': '_all', 'label': _('All')}] + [
2425
        agenda_options = [{'id': '_all', 'label': pgettext('agendas', 'All')}] + [
2425 2426
            {'id': x.slug, 'label': x.label} for x in agendas
2426 2427
        ]
2427 2428
        booking_check_filters = set()
2428
-