aeb76eb68f19b1f15e5755556b1a0270de124060
[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://artlibre.org/licence/lal/pl/': {
13         'icon': 'lal',
14         'description': _('Licencja Wolnej Sztuki 1.3'),
15         'locative': 'Licencji Wolnej Sztuki 1.3',
16     }
17 }
18 LICENSES['http://creativecommons.org/licenses/by-sa/3.0/deed.pl'] = \
19     LICENSES['http://creativecommons.org/licenses/by-sa/3.0/']
20 LICENSES['http://creativecommons.org/licenses/by-sa/4.0/deed.pl'] = \
21     LICENSES['http://creativecommons.org/licenses/by-sa/3.0/']
22
23 for license, data in list(LICENSES.items()):
24     LICENSES[license.replace('http://', 'https://')] = data
25
26 # Those will be generated only for books with own HTML.
27 EBOOK_FORMATS_WITHOUT_CHILDREN = ['txt', 'fb2']
28 # Those will be generated for all books.
29 EBOOK_FORMATS_WITH_CHILDREN = ['pdf', 'epub', 'mobi']
30 # Those will be generated when inherited cover changes.
31 EBOOK_FORMATS_WITH_COVERS = ['pdf', 'epub', 'mobi']
32
33 EBOOK_FORMATS = EBOOK_FORMATS_WITHOUT_CHILDREN + EBOOK_FORMATS_WITH_CHILDREN
34
35 EBOOK_CONTENT_TYPES = {
36     'html': 'text/html',
37     'pdf': 'application/pdf',
38     'txt': 'text/plain; charset=utf-8',
39     'epub': 'application/epub+zip',
40     'mobi': 'application/x-mobipocket-ebook',
41     'fb2': 'text/xml',
42     'xml': 'text/xml',
43 }
44
45 LANGUAGES_3TO2 = {
46     'deu': 'de',
47     'ger': 'de',
48     'eng': 'en',
49     'spa': 'es',
50     'fra': 'fr',
51     'fre': 'fr',
52     'ita': 'it',
53     'jpn': 'jp',
54     'lit': 'lt',
55     'pol': 'pl',
56     'rus': 'ru',
57     'ukr': 'uk',
58 }
59
60 CATEGORIES_NAME_PLURAL = {
61     'author': _('autorzy'),
62     'epoch': _('epoki'),
63     'kind': _('rodzaje'),
64     'genre': _('gatunki'),
65     'theme': _('motywy'),
66     'set': _('półki'),
67     'thing': _('obiekty'),
68 }
69
70 WHOLE_CATEGORY = {
71     'author': _('Wszyscy autorzy'),
72     'epoch': _('Wszystkie epoki'),
73     'kind': _('Wszystkie rodzaje'),
74     'genre': _('Wszystkie gatunki'),
75     'theme': _('Wszystkie motywy'),
76     'set': _('Wszystkie półki'),
77     'thing': _('Wszystkie obiekty'),
78 }