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