Translate table titles in header

This commit is contained in:
Mouse Reeve 2021-03-02 09:59:15 -08:00
parent 8bb7d5bba0
commit 5938c438e2
2 changed files with 6 additions and 1 deletions

View file

@ -3,7 +3,7 @@
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block panel %} {% block panel %}
<h1 class="title">{% blocktrans with tab_title=tab|title %}{{ tab_title }} Timeline{% endblocktrans %}</h1> <h1 class="title">{% blocktrans %}{{ tab_title }} Timeline{% endblocktrans %}</h1>
<div class="tabs"> <div class="tabs">
<ul> <ul>
<li class="{% if tab == 'home' %}is-active{% endif %}"> <li class="{% if tab == 'home' %}is-active{% endif %}">

View file

@ -6,6 +6,7 @@ from django.http import HttpResponseNotFound
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.utils import timezone from django.utils import timezone
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.utils.translation import gettext as _
from django.views import View from django.views import View
from bookwyrm import forms, models from bookwyrm import forms, models
@ -29,18 +30,22 @@ class Feed(View):
if tab == 'home': if tab == 'home':
activities = get_activity_feed( activities = get_activity_feed(
request.user, following_only=True) request.user, following_only=True)
tab_title = _('Home')
elif tab == 'local': elif tab == 'local':
activities = get_activity_feed( activities = get_activity_feed(
request.user, privacy=['public', 'followers'], local_only=True) request.user, privacy=['public', 'followers'], local_only=True)
tab_title = _('Local')
else: else:
activities = get_activity_feed( activities = get_activity_feed(
request.user, privacy=['public', 'followers']) request.user, privacy=['public', 'followers'])
tab_title = _('Federated')
paginated = Paginator(activities, PAGE_LENGTH) paginated = Paginator(activities, PAGE_LENGTH)
data = {**feed_page_data(request.user), **{ data = {**feed_page_data(request.user), **{
'user': request.user, 'user': request.user,
'activities': paginated.page(page), 'activities': paginated.page(page),
'tab': tab, 'tab': tab,
'tab_title': tab_title,
'goal_form': forms.GoalForm(), 'goal_form': forms.GoalForm(),
'path': '/%s' % tab, 'path': '/%s' % tab,
}} }}