Moves tab title translations into templates

This commit is contained in:
Mouse Reeve 2021-03-22 18:42:12 -07:00
parent 3efabf1da3
commit 2fe9d1044a
2 changed files with 9 additions and 9 deletions

View file

@ -3,7 +3,15 @@
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block panel %} {% block panel %}
<h1 class="title">{% blocktrans %}{{ tab_title }} Timeline{% endblocktrans %}</h1> <h1 class="title">
{% if tab == 'home' %}
{% trans "Home Timeline" %}
{% elif tab == 'local' %}
{% trans "Local Timeline" %}
{% else %}
{% trans "Federated Timeline" %}
{% endif %}
</h1>
<div class="tabs"> <div class="tabs">
<ul> <ul>
<li class="{% if tab == 'home' %}is-active{% endif %}"{% if tab == 'home' %} aria-current="page"{% endif %}> <li class="{% if tab == 'home' %}is-active{% endif %}"{% if tab == 'home' %} aria-current="page"{% endif %}>

View file

@ -6,7 +6,6 @@ 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 activitystreams, forms, models from bookwyrm import activitystreams, forms, models
@ -31,12 +30,6 @@ class Feed(View):
if not tab in STREAMS: if not tab in STREAMS:
tab = 'home' tab = 'home'
tab_title = {
'home': _("Home"),
"local": _("Local"),
"federated": _("Federated")
}[tab]
activities = activitystreams.streams[tab].get_activity_stream(request.user) activities = activitystreams.streams[tab].get_activity_stream(request.user)
paginated = Paginator(activities, PAGE_LENGTH) paginated = Paginator(activities, PAGE_LENGTH)
@ -47,7 +40,6 @@ class Feed(View):
"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,
}, },