minor fix
[wolnelektury.git] / src / catalogue / constants.py
1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from django.utils.translation import gettext_lazy as _
5
6 LICENSES = {
7     'http://creativecommons.org/licenses/by-sa/3.0/': {
8         'icon': 'cc-by-sa',
9         'description': _('Creative Commons Attribution-ShareAlike 3.0 Unported'),
10         'locative': 'licencji CC BY-SA 3.0 PL',
11     },
12     'http://creativecommons.org/licenses/by-sa/4.0/deed.pl': {
13         'icon': 'cc-by-sa',
14         'description': _('Creative Commons Attribution-ShareAlike 4.0 Unported'),
15         'locative': 'licencji CC BY-SA 4.0 PL',
16     },
17     'http://artlibre.org/licence/lal/pl/': {
18         'icon': 'lal',
19         'description': _('Licencja Wolnej Sztuki 1.3'),
20         'locative': 'Licencji Wolnej Sztuki 1.3',
21     }
22 }
23 LICENSES['http://creativecommons.org/licenses/by-sa/3.0/deed.pl'] = \
24     LICENSES['http://creativecommons.org/licenses/by-sa/3.0/']
25
26 for license, data in list(LICENSES.items()):
27     LICENSES[license.replace('http://', 'https://')] = data
28
29 # Those will be generated only for books with own HTML.
30 EBOOK_FORMATS_WITHOUT_CHILDREN = ['txt', 'fb2']
31 # Those will be generated for all books.
32 EBOOK_FORMATS_WITH_CHILDREN = ['pdf', 'epub', 'mobi']
33 # Those will be generated when inherited cover changes.
34 EBOOK_FORMATS_WITH_COVERS = ['pdf', 'epub', 'mobi']
35
36 EBOOK_FORMATS = EBOOK_FORMATS_WITHOUT_CHILDREN + EBOOK_FORMATS_WITH_CHILDREN
37
38 EBOOK_CONTENT_TYPES = {
39     'html': 'text/html',
40     'pdf': 'application/pdf',
41     'txt': 'text/plain; charset=utf-8',
42     'epub': 'application/epub+zip',
43     'mobi': 'application/x-mobipocket-ebook',
44     'fb2': 'text/xml',
45     'xml': 'text/xml',
46 }
47
48 LANGUAGES_3TO2 = {
49     'deu': 'de',
50     'ger': 'de',
51     'eng': 'en',
52     'spa': 'es',
53     'fra': 'fr',
54     'fre': 'fr',
55     'ita': 'it',
56     'jpn': 'jp',
57     'lit': 'lt',
58     'pol': 'pl',
59     'rus': 'ru',
60     'ukr': 'uk',
61 }
62
63 CATEGORIES_NAME_PLURAL = {
64     'author': _('autorzy'),
65     'epoch': _('epoki'),
66     'kind': _('rodzaje'),
67     'genre': _('gatunki'),
68     'theme': _('motywy'),
69     'set': _('półki'),
70     'thing': _('obiekty'),
71 }
72
73 WHOLE_CATEGORY = {
74     'author': _('Wszyscy autorzy'),
75     'epoch': _('Wszystkie epoki'),
76     'kind': _('Wszystkie rodzaje'),
77     'genre': _('Wszystkie gatunki'),
78     'theme': _('Wszystkie motywy'),
79     'set': _('Wszystkie półki'),
80     'thing': _('Wszystkie obiekty'),
81 }