Merge branch 'preview'
[wolnelektury.git] / src / catalogue / constants.py
1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 from django.utils.translation import ugettext_lazy as _
6
7 LICENSES = {
8     'http://creativecommons.org/licenses/by-sa/3.0/': {
9         'icon': 'cc-by-sa',
10         'description': _('Creative Commons Attribution-ShareAlike 3.0 Unported'),
11     },
12     'http://artlibre.org/licence/lal/pl/': {
13         'icon': 'lal',
14         'description': _('Free Art License 1.3'),
15     }
16 }
17 LICENSES['http://creativecommons.org/licenses/by-sa/3.0/deed.pl'] = \
18     LICENSES['http://creativecommons.org/licenses/by-sa/3.0/']
19
20 # Those will be generated only for books with own HTML.
21 EBOOK_FORMATS_WITHOUT_CHILDREN = ['txt', 'fb2']
22 # Those will be generated for all books.
23 EBOOK_FORMATS_WITH_CHILDREN = ['pdf', 'epub', 'mobi']
24 # Those will be generated when inherited cover changes.
25 EBOOK_FORMATS_WITH_COVERS = ['pdf', 'epub', 'mobi']
26
27 EBOOK_FORMATS = EBOOK_FORMATS_WITHOUT_CHILDREN + EBOOK_FORMATS_WITH_CHILDREN
28
29 EBOOK_CONTENT_TYPES = {
30     'html': 'text/html',
31     'pdf': 'application/pdf',
32     'txt': 'text/plain',
33     'epub': 'application/epub+zip',
34     'mobi': 'application/x-mobipocket-ebook',
35     'fb2': 'text/xml',
36     'xml': 'text/xml',
37 }
38
39 LANGUAGES_3TO2 = {
40     'deu': 'de',
41     'ger': 'de',
42     'eng': 'en',
43     'spa': 'es',
44     'fra': 'fr',
45     'fre': 'fr',
46     'ita': 'it',
47     'jpn': 'jp',
48     'lit': 'lt',
49     'pol': 'pl',
50     'rus': 'ru',
51     'ukr': 'uk',
52 }
53
54 CATEGORIES_NAME_PLURAL = {
55     'author': _('authors'),
56     'epoch': _('epochs'),
57     'kind': _('kinds'),
58     'genre': _('genres'),
59     'theme': _('themes'),
60     'set': _('sets'),
61     'thing': _('things'),
62 }
63
64 WHOLE_CATEGORY = {
65     'author': _('All authors'),
66     'epoch': _('All epochs'),
67     'kind': _('All kinds'),
68     'genre': _('All genres'),
69     'theme': _('All themes'),
70     'set': _('All sets'),
71     'thing': _('All things'),
72 }