From: Radek Czajka Date: Mon, 3 Nov 2014 14:47:58 +0000 (+0100) Subject: Notes dictionary: language names. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/3b4b52aebe1b09fe03b3314158f31c4ef83db425?hp=2d755ff729a4752c26b8dc3526f7ef0dc2c39fc0 Notes dictionary: language names. --- diff --git a/apps/dictionary/templates/dictionary/note_list.html b/apps/dictionary/templates/dictionary/note_list.html index 3d4916c7d..9428655b0 100755 --- a/apps/dictionary/templates/dictionary/note_list.html +++ b/apps/dictionary/templates/dictionary/note_list.html @@ -76,12 +76,12 @@ {% trans "all" %} {% endif %} -{% for lang in languages %} +{% for lang, lang_name in languages %} | {% if lang == language %} - {{ lang }} + {{ lang_name }} {% else %} - {{ lang }} + {{ lang_name }} {% endif %} {% endfor %}

diff --git a/apps/dictionary/views.py b/apps/dictionary/views.py index 76530bc42..40b36baf4 100755 --- a/apps/dictionary/views.py +++ b/apps/dictionary/views.py @@ -3,7 +3,9 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.views.generic.list import ListView +from django.conf import settings from django.db.models import Count, Q +from catalogue.constants import LANGUAGES_3TO2 from .constants import FN_TYPES from .models import Note, Qualifier @@ -50,6 +52,10 @@ class NotesView(ListView): nobj = nobj.filter(fltr) self.languages = nobj.order_by('language').values_list( 'language', flat=True).distinct() + lang_names = dict(settings.LANGUAGES) + self.languages = [ + (lang, lang_names.get(LANGUAGES_3TO2.get(lang, lang), lang)) + for lang in self.languages] nobj = objects for key, fltr in filters.items(): diff --git a/apps/wolnelektury_core/templates/main_page.html b/apps/wolnelektury_core/templates/main_page.html index 118f3ac55..17dc2e6d9 100755 --- a/apps/wolnelektury_core/templates/main_page.html +++ b/apps/wolnelektury_core/templates/main_page.html @@ -46,7 +46,7 @@
  • {% trans "Report a bug or suggestion" %}
  • {% trans "Download the catalogue in PDF format." %}
  • - +
  • {% trans "Footnotes" %}
  • {% trans "Missing a book?" %}
  • {% trans "Publishing plan" %}
  • API