import sys
import pprint
import traceback
+ import re
from django.conf import settings
from django.template import RequestContext
from django.utils import simplejson
from django.utils.functional import Promise
from django.utils.encoding import force_unicode
+ from django.utils.http import urlquote_plus
from django.views.decorators import cache
++from django.utils.translation import ugettext as _
from catalogue import models
from catalogue import forms
# ==========
# = Search =
# ==========
+
+ def _no_diacritics_regexp(query):
+ """ returns a regexp for searching for a query without diacritics
+
+ should be locale-aware """
+ names = {'a':u'ą', 'c':u'ć', 'e':u'ę', 'l': u'ł', 'n':u'ń', 'o':u'ó', 's':u'ś', 'z':u'ź|ż'}
+ def repl(m):
+ l = m.group()
+ return "(%s|%s)" % (l, names[l])
+ return re.sub('[%s]'%(''.join(names.keys())), repl, query)
+
def _word_starts_with(name, prefix):
- """returns a Q object gettings models having `name` contain a word
+ """returns a Q object getting models having `name` contain a word
starting with `prefix`
"""
kwargs = {}
if settings.DATABASE_ENGINE in ('mysql', 'postgresql_psycopg2', 'postgresql'):
- # we must escape `prefix` so that it only matches literally
- for special in r'\^$.*+?|(){}[]':
- prefix = prefix.replace(special, '\\' + special)
-
+ prefix = _no_diacritics_regexp(re.escape(prefix))
# we could use a [[:<:]] (word start),
# but we want both `xy` and `(xy` to catch `(xyz)`
kwargs['%s__iregex' % name] = u"(^|[^[:alpha:]])%s" % prefix
return Q(**kwargs)
+ def _tags_exact_matches(prefix, user):
+ book_stubs = models.BookStub.objects.filter(title__iexact = prefix)
+ books = models.Book.objects.filter(title__iexact = prefix)
+ book_stubs = filter(lambda x: x not in books, book_stubs)
+ tags = models.Tag.objects.filter(name__iexact = prefix)
+ if user.is_authenticated():
+ tags = tags.filter(~Q(category='book') & (~Q(category='set') | Q(user=user)))
+ else:
+ tags = tags.filter(~Q(category='book') & ~Q(category='set'))
+
+ return list(books) + list(tags) + list(book_stubs)
+
+
def _tags_starting_with(prefix, user):
book_stubs = models.BookStub.objects.filter(_word_starts_with('title', prefix))
books = models.Book.objects.filter(_word_starts_with('title', prefix))
return list(books) + list(tags) + list(book_stubs)
+
+ def _get_result_link(match, tag_list):
+ if isinstance(match, models.Book) or isinstance(match, models.BookStub):
+ return match.get_absolute_url()
+ else:
+ return reverse('catalogue.views.tagged_object_list',
+ kwargs={'tags': '/'.join(tag.slug for tag in tag_list + [match])}
+ )
+
+ def _get_result_type(match):
+ if isinstance(match, models.Book) or isinstance(match, models.BookStub):
+ type = 'book'
+ else:
+ type = match.category
+ return dict(models.TAG_CATEGORIES)[type]
+
+
+
def search(request):
tags = request.GET.get('tags', '')
prefix = request.GET.get('q', '')
# Prefix must have at least 2 characters
if len(prefix) < 2:
- return render_to_response('catalogue/search_no_hits.html', {'query':prefix, 'tags':tag_list},
+ return render_to_response('catalogue/search_too_short.html', {'tags':tag_list, 'prefix':prefix},
context_instance=RequestContext(request))
- result = _tags_starting_with(prefix, request.user)
- if len(result) > 0:
- tag = result[0]
- if isinstance(tag, models.Book) or isinstance(tag, models.BookStub):
- return HttpResponseRedirect(tag.get_absolute_url())
- else:
- tag_list.append(tag)
-
- return HttpResponseRedirect(reverse('catalogue.views.tagged_object_list',
- kwargs={'tags': '/'.join(tag.slug for tag in tag_list)}
- ))
+ result = _tags_exact_matches(prefix, request.user)
+
+ if len(result) > 1:
+ # multiple exact matches
+ return render_to_response('catalogue/search_multiple_hits.html',
+ {'tags':tag_list, 'prefix':prefix, 'results':((x, _get_result_link(x, tag_list), _get_result_type(x)) for x in result)},
+ context_instance=RequestContext(request))
+
+ if not result:
+ # no exact matches
+ result = _tags_starting_with(prefix, request.user)
+
+ if result:
+ return HttpResponseRedirect(_get_result_link(result[0], tag_list))
else:
- return render_to_response('catalogue/search_no_hits.html', {'query':prefix, 'tags':tag_list},
+ return render_to_response('catalogue/search_no_hits.html', {'tags':tag_list, 'prefix':prefix},
context_instance=RequestContext(request))
book_sets = book.tags.filter(category='set', user=request.user)
if not request.user.is_authenticated():
- return HttpResponse('<p>Aby zarządzać swoimi półkami, musisz się zalogować.</p>')
+ return HttpResponse(_('<p>To maintain your shelves you need to be logged in.</p>'))
if request.method == 'POST':
form = forms.ObjectSetsForm(book, request.user, request.POST)
book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user)))
if request.is_ajax():
- return HttpResponse('<p>Półki zostały zapisane.</p>')
+ return HttpResponse(_('<p>Shelves were sucessfully saved.</p>'))
else:
return HttpResponseRedirect('/')
else:
shelf.book_count -= 1
shelf.save()
- return HttpResponse('Usunięto')
+ return HttpResponse(_('Book was successfully removed from the shelf'))
else:
- return HttpResponse('Książki nie ma na półce')
+ return HttpResponse(_('This book is not on the shelf'))
def collect_books(books):
formats = ['pdf', 'odt', 'txt', 'mp3', 'ogg']
# Create a ZIP archive
- temp = temp = tempfile.TemporaryFile()
+ temp = tempfile.TemporaryFile()
archive = zipfile.ZipFile(temp, 'w')
for book in collect_books(models.Book.tagged.with_all(shelf)):
new_set = new_set_form.save(request.user)
if request.is_ajax():
- return HttpResponse(u'<p>Półka <strong>%s</strong> została utworzona</p>' % new_set)
+ return HttpResponse(_('<p>Shelf <strong>%s</strong> was successfully created</p>') % new_set)
else:
return HttpResponseRedirect('/')
user_set.delete()
if request.is_ajax():
- return HttpResponse(u'<p>Półka <strong>%s</strong> została usunięta</p>' % user_set.name)
+ return HttpResponse(_('<p>Shelf <strong>%s</strong> was successfully removed</p>') % user_set.name)
else:
return HttpResponseRedirect('/')
@cache.never_cache
def logout_then_redirect(request):
auth.logout(request)
- return HttpResponseRedirect(request.GET.get('next', '/'))
+ return HttpResponseRedirect(urlquote_plus(request.GET.get('next', '/'), safe='/?='))
info = sys.exc_info()
exception = pprint.pformat(info[1])
tb = '\n'.join(traceback.format_tb(info[2]))
- return HttpResponse("An error occurred: %s\n\n%s" % (exception, tb), mimetype='text/plain')
- return HttpResponse("Book imported successfully")
+ return HttpResponse(_("An error occurred: %s\n\n%s") % (exception, tb), mimetype='text/plain')
+ return HttpResponse(_("Book imported successfully"))
else:
- return HttpResponse("Error importing file: %r" % book_import_form.errors)
+ return HttpResponse(_("Error importing file: %r") % book_import_form.errors)
in a format suitable for Date.parse()
"""
from datetime import datetime
- return HttpResponse(datetime.now().strftime('%Y/%m/%d %H:%M:%S'))
+ return HttpResponse(datetime.now().strftime('%Y/%m/%d %H:%M:%S'))
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
+ 'wolnelektury.context_processors.extra_settings',
]
MIDDLEWARE_CLASSES = [
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.admindocs',
-
+
# external
'south',
'sorl.thumbnail',
'output_filename': 'js/jquery.min.js',
},
'all': {
- 'source_filenames': ('js/jquery.autocomplete.js', 'js/jquery.form.js',
- 'js/jquery.countdown.js', 'js/jquery.countdown-pl.js',
+ 'source_filenames': ('js/jquery.autocomplete.js', 'js/jquery.form.js',
+ 'js/jquery.countdown.js', 'js/jquery.countdown-pl.js',
+ 'js/jquery.countdown-en.js', 'js/jquery.countdown-de.js',
+ 'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js',
+ 'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js',
'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',
'js/jquery.cookie.js',),
'output_filename': 'js/all?.min.js',
- alert(LANGUAGE_CODE);
+var LOCALE_TEXTS = {
+ "pl": {
+ "DELETE_SHELF": "Czy na pewno usunąć półkę",
+ "HIDE_DESCRIPTION": "Zwiń opis",
+ "EXPAND DESCRIPTION": "Rozwiń opis",
+ "LOADING": "Ładowanie",
+ },
+ "fr": {
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ },
+ "ru": {
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ },
+ "en": {
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ },
+ "ru": {
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ },
+ "es": {
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ },
+ "lt":{
+ "DELETE_SHELF": "Translate me!",
+ "HIDE_DESCRIPTION": "Translate me!",
+ "EXPAND DESCRIPTION": "Translate me!",
+ "LOADING": "Translate me!",
+ }
+}
-
- alert(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']);
var BANNER_TEXTS = [
'Przekaż 1% żeby ukryć ten baner.',
'Jak dobrze wydać 1% swojego podatku? <strong>Poradnik dla opornych</strong>.',
function() { $(this).css({background: '#FFF'}); }
).click(function() {
$(this).fadeOut(function() {
- $(this).prev().fadeIn()
+ $(this).prev().fadeIn();
});
+ return false;
})
}
});
$('.fragment-short-text').click(function() {
$(this).fadeOut(function() { $(this).next().fadeIn() });
+ return false;
}).hover(
function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
function() { $(this).css({background: '#FFF'}); }
$('.delete-shelf').click(function() {
var link = $(this);
var shelf_name = $('.visit-shelf', link.parent()).text();
- if (confirm('Czy na pewno usunąć półkę ' + shelf_name + '?')) {
+ if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+ ' '+ shelf_name + '?')) {
$.post(link.attr('href'), function(data, textStatus) {
link.parent().remove();
});
$('.delete-shelf').click(function() {
var link = $(this);
var shelf_name = $('.visit-shelf', link.parent()).text();
- if (confirm('Czy na pewno usunąć półkę ' + shelf_name + '?')) {
+ if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF'] + ' ' + shelf_name + '?')) {
$.post(link.attr('href'), function(data, textStatus) {
link.parent().remove();
});
if ($('#description').hasClass('hidden')) {
$('#description').slideDown('fast').removeClass('hidden');
$.cookie('description-state', 'opened', {path: '/', expires: 30});
- $('p', this).html('Zwiń opis ▲');
+ $('p', this).html(LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▲');
} else {
$('#description').slideUp('fast').addClass('hidden');
$.cookie('description-state', 'closed', {path: '/', expires: 30});
- $('p', this).html('Rozwiń opis ▼');
+ $('p', this).html(LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▼');
}
});
trigger: 'a.jqm-trigger',
onShow: function(hash) {
var offset = $(hash.t).offset();
- target.html('<p><img src="/static/img/indicator.gif" /> Ładowanie</p>');
+ target.html('<p><img src="/static/img/indicator.gif" />'+LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+'</p>');
hash.w.css({position: 'absolute', left: offset.left, top: offset.top}).show() },
onLoad: function(hash) {
$('form', hash.w).ajaxForm({
if ($.cookie('description-state') == 'closed') {
$('#description').hide().addClass('hidden');
- $('#toggle-description p').html('Rozwiń opis ▼');
+ $('#toggle-description p').html(LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_SHELF']+' ▼');
}
$('#user-info').show();
$('#download-shelf-menu').slideDown('fast');
if (!formatsDownloaded) {
- // Pobierz dane o formatach
+ // Get info about the formats
formatsDownloaded = true;
$.ajax({
url: $('#download-formats-form').attr('data-formats-feed'),
<title>404 - {% trans "Site does not exist" %} - WolneLektury.pl</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset/reset-min.css">
- <link rel="stylesheet" href="/static/css/error.css" type="text/css" />
+ <link rel="stylesheet" href="{{ STATIC_URL }}css/error.css" type="text/css" />
</head>
<body>
- <a href="/"><img src="/static/img/logo.png" /></a>
+ <a href="/"><img src="{{ STATIC_URL }}img/logo.png" /></a>
<p class="haj" style="font-weight: bold">{% trans "Site does not exist" %}</p>
<p>
-{% trans "We are sorry, but this site does not exist. Please check if you entered correct address or go to "%} <a href="/">{% trans "homepage" %}</a>.
+{% trans "We are sorry, but this site does not exist. Please check if you entered correct address or go to "%} <a href="/">{% trans "main page" %}</a>.
</p>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
<title>500 - {% trans "Server error" %} WolneLektury.pl</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset/reset-min.css">
- <link rel="stylesheet" href="/static/css/error.css" type="text/css" />
+ <link rel="stylesheet" href="{{ STATIC_URL }}css/error.css" type="text/css" />
</head>
<body>
- <a href="/"><img src="/static/img/logo.png" /></a>
+ <a href="/"><img src="{{ STATIC_URL }}img/logo.png" /></a>
<p class="haj" style="font-weight: bold">{% trans "Server error" %}</p>
<p>
-{% trans "We are sorry for your inconvenience, but server error occured. We are working on fixing it as soon as possible. Meanwhile, please go to " %}<a href="/">{% trans "homepage" %}</a>.
+{% trans "We are sorry for your inconvenience, but server error occured. We are working on fixing it as soon as possible. Meanwhile, please go to " %}<a href="/">{% trans "main page" %}</a>.
</p>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{% block title %}WolneLektury.pl{% endblock %}</title>
- <link rel="icon" href="/static/img/favicon.png" type="image/x-icon" />
+ <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/x-icon" />
{% compressed_css "all" %}
+ <script type="text/javascript">var LANGUAGE_CODE = "{{ LANGUAGE_CODE}}";</script>
{% compressed_js "jquery" %}
{% compressed_js "all" %}
{% block extrahead %}
{% endblock %}
</head>
<body id="{% block bodyid %}base{% endblock %}">
- <!--[if lt IE 7]><link href=/static/infobar/infobar.css rel=stylesheet>
+ <!--[if lt IE 7]><link href={{ STATIC_URL }}infobar/infobar.css rel=stylesheet>
<div id=infobar><a href=http://browsehappy.pl/infobar>
{% trans "Internet Explorer cannot display this site properly. Click here to read more..." %}
- </a></div><div id=viewplot><script src=/static/infobar/infobar.js></script><![endif]-->
+ </a></div><div id=viewplot><script src={{ STATIC_URL }}infobar/infobar.js></script><![endif]-->
{% block bodycontent %}
<div id="top-message">
{% chunk "top-message" %}
</div>
<div id="header">
<div id="logo">
- <a href="/"><img src="/static/img/logo.png" alt="WolneLektury.pl - logo" /></a>
+ <a href="/"><img src="{{ STATIC_URL }}img/logo.png" alt="WolneLektury.pl - logo" /></a>
</div>
<div id="user-info" style="display:none">
{% if user.is_authenticated %}
{% endif %}
</div>
<div class="social-links" style="float:right">
- <a href="http://pl-pl.facebook.com/pages/Wolne-Lektury/203084073268"><img src="/static/img/social/facebook.png" /></a>
- <a href="http://twitter.com/wolnelektury"><img src="/static/img/social/twitter.png" /></a>
- <a href="http://nasza-klasa.pl/profile/30441509"><img src="/static/img/social/naszaklasa.png" /></a>
+ <a href="http://pl-pl.facebook.com/pages/Wolne-Lektury/203084073268"><img src="{{ STATIC_URL }}img/social/facebook.png" /></a>
+ <a href="http://twitter.com/wolnelektury"><img src="{{ STATIC_URL }}img/social/twitter.png" /></a>
+ <a href="http://nasza-klasa.pl/profile/30441509"><img src="{{ STATIC_URL }}img/social/naszaklasa.png" /></a>
</div>
+ <div class="lang-menu" style="float:right;">
+ <form action="/i18n/setlang/" method="post">
+ {% trans "Choose your interface language: " %} <select name="language">
+ {% for lang in LANGUAGES %}
+ <option value="{{ lang.0 }}"{% ifequal lang.0 LANGUAGE_CODE %} selected="selected"{% endifequal %}>{{ lang.1 }}</option>
+ {% endfor %}
+ </select>
+ <input type="submit" value="{% trans "Choose language" %}">
+ </form>
+ </div>
<div class="clearboth"></div>
</div>
<div id="maincontent">
<div class="clearboth"></div>
<div id="footer">
<p>
- Wolne Lektury to projekt prowadzony przez <a href="http://nowoczesnapolska.org.pl/">Fundację Nowoczesna
- Polska</a>. Reprodukcje cyfrowe wykonane przez <a href="http://www.bn.org.pl/">Bibliotekę Narodową</a>
- z egzemplarzy pochodzących ze zbiorów BN. Hosting <a href="http://eo.pl/">EO Networks</a>.
+ {% blocktrans %}
+ Wolne Lektury is a project lead by <a href="http://nowoczesnapolska.org.pl/">Modern Poland Foundation</a>.
+ Digital reproductions are made by <a href="http://www.bn.org.pl/">The National Library</a>, based on TNL resources.
+ Hosting <a href="http://eo.pl/">EO Networks</a>.
+ {% endblocktrans %}
</p>
<p>
- Fundacja Nowoczesna Polska, 00-514 Warszawa, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17,
+ {% blocktrans %}
+ Modern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17
e-mail: <a href="mailto:fundacja@nowoczesnapolska.org.pl">fundacja@nowoczesnapolska.org.pl</a>
+ {% endblocktrans %}
</p>
{% sponsor_page "footer" %}
<div id="user-shelves-window">
<div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
<div class="target">
- <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
+ <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
</div>
</div>
{% endblock bodycontent %}
pageTracker._trackPageview();
</script>
</body>
-</html>
+</html>
{% load i18n %}
{% load catalogue_tags pagination_tags %}
-{% block title %}{{ book.title }} w WolneLektury.pl{% endblock %}
+{% block title %}{{ book.title }} {% trans "on WolneLektury.pl" %}{% endblock %}
{% block bodyid %}book-detail{% endblock %}
{% block body %}
<h1>{{ book.title }}, {{ categories.author|join:", " }}</h1>
<form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form">
- <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to homepage" %}</a></p>
+ <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to main page" %}</a></p>
</form>
<div id="books-list">
{% endif %}
{% if book.mp3_file %}
<div id="czytamy-sluchajac-info">
- <a href="http://czytamysluchajac.pl/" id="czytamysluchajac-logo"><img src="/static/img/czytamysluchajac-logo-small.png" /></a>
+ <a href="http://czytamysluchajac.pl/" id="czytamysluchajac-logo"><img src="{{ STATIC_URL }}img/czytamysluchajac-logo-small.png" /></a>
<p>{% trans "Artist" %}: {{ book.get_extra_info_value.artist_name }}</p>
{% if book.get_extra_info_value.director_name %}
<p>{% trans "Director" %}: {{ book.get_extra_info_value.director_name }}</p>
{% if book.mp3_file %}<a href="{{ book.mp3_file.url }}">{% trans "Download MP3" %}</a>{% endif %}
{% if book.ogg_file %}<a href="{{ book.ogg_file.url }}">{% trans "Download Ogg Vorbis" %}</a>{% endif %}
{% if book.mp3_file %}
- <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="/static/player.swf" width="426" height="20">
- <param name="movie" value="/static/player.swf" />
+ <object type="application/x-shockwave-flash" style="margin-top: 0.5em" data="{{ STATIC_URL }}player.swf" width="426" height="20">
+ <param name="movie" value="{{ STATIC_URL }}player.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3={{ book.mp3_file.url }}&width=426&showvolume=1&bgcolor1=eeeeee&bgcolor2=eeeeee&buttoncolor=666666" />
</object>
<div id="set-window">
<div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
<div class="target">
- <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
+ <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
</div>
</div>
{% endblock %}
{% extends "base.html" %}
+{% load i18n %}
{% load catalogue_tags pagination_tags %}
-{% block title %}Lektura {{ book.title }} w WolneLektury.pl{% endblock %}
+{% block title %}{{ book.title }} w WolneLektury.pl{% endblock %}
{% block bodyid %}book-stub-detail{% endblock %}
{% block body %}
<h1>{{ book.title }}, {{ book.author }}</h1>
<form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form">
- <p>{{ form.q }} <input type="submit" value="Szukaj" /> <strong>lub</strong> <a href="{% url main_page %}">wróć do strony głównej</a></p>
+ <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to main page" %}</a></p>
</form>
<div id="books-list">
{% if book.in_pd %}
- To dzieło znajduje się w domenie publicznej i niedługo zostanie
- opublikowane w szkolnej bibliotece internetowej Wolne Lektury.
+ {% trans "This author's works are in public domain and will be published on Internet school library of Wolne Lektury soon." %}
{% else %}
{% if book.pd %}
- To dzieło przejdzie
- do zasobów domeny publicznej i będzie mogło być publikowane bez
- żadnych ograniczeń za:
+ {% trans "This author's works will become part of public domain and will be allowed to be published without restrictions in:" %}
{% include "catalogue/pd_counter.html" %}
{% else %}
- To dzieło objęte jest prawem autorskim.
+ {% trans "This author's works are copyrighted." %}
{% endif %}
{% endif %}
{% include "info/join_us.html" %}
</div>
<div id="set-window">
- <div class="header"><a href="#" class="jqmClose">Zamknij</a></div>
+ <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
<div class="target">
- <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
- <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> Ładowanie</p>
++ <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
</div>
</div>
{% endblock %}
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{% block title %}WolneLektury.pl{% endblock %}</title>
- <link rel="icon" href="/static/img/favicon.png" type="image/x-icon" />
+ <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/x-icon" />
{% compressed_css "book" %}
{% compressed_js "jquery" %}
{% compressed_js "book" %}
<body>
<div id="menu">
<ul>
- <li><a href="#toc">{% trans "Table of content" %}</a></li>
+ <li><a href="#toc">{% trans "Table of contents" %}</a></li>
<li><a href="#themes">{% trans "Themes" %}</a></li>
</ul>
</div>
<div id="header">
<div id="logo">
- <a href="/"><img src="/static/img/logo.png" alt="WolneLektury.pl - logo" /></a>
+ <a href="/"><img src="{{ STATIC_URL }}img/logo.png" alt="WolneLektury.pl - logo" /></a>
</div>
</div>
<div id="themes">
<p class="see-more"><a href="{% url lessons_document_list %}">{% trans " See more" %} ⇒</a></p>
</div>
<div id="czytamysluchajac">
- <a href="http://czytamysluchajac.pl/"><img src="/static/img/czytamysluchajac-logo-small.png" /></a>
+ <a href="http://czytamysluchajac.pl/"><img src="{{ STATIC_URL }}img/czytamysluchajac-logo-small.png" /></a>
<p><a href="http://czytamysluchajac.pl/">Czytamy Słuchając</a> {% trans "are professional recordings of literary texts from our repository, available on free license in MP3 and Ogg Vorbis formats as well as in DAISY system." %}</p>
<p class="see-more"><a href="http://czytamysluchajac.pl/index.php/o-projekcie/">{% trans "See more" %} ⇒</a></p>
</div>
</div>
<div id="you-can-help">
<h2>{% trans "You can help us!" %}</h2>
- <p>{% trans "Works appended constantly to " %}Utwory włączane sukcesywnie do naszej biblioteki staramy się opracowywać jak najdokładniej. Jest to możliwe tylko dzięki współpracującym z nami wolontariuszom.</p>
- <p>Zapraszamy wszystkie osoby, które chcą współtworzyć szkolną bibliotekę internetową Wolne Lektury.</p>
- <p class="see-more"><a href="{% url help_us %}">Zobacz więcej ⇒</a></p>
+ <p>{% trans "We try our best to elaborate works appended to our library. It is possible only due to support of our volunteers." %}</p>
+ <p>{% trans "We invite people who want to take part in developing Internet school library Wolne Lektury." %}</p>
+ <p class="see-more"><a href="{% url help_us %}">{% trans "See more" %} ⇒</a></p>
</div>
<div id="about-us">
- <h2>O projekcie</h2>
- <p>Biblioteka internetowa z lekturami szkolnymi „Wolne Lektury” (<a href="http://wolnelektury.pl">www.wolnelektury.pl</a>) to projekt realizowany przez Fundację Nowoczesna Polska. Działa od 2007 roku i udostępnia w swoich zbiorach lektury szkolne, które są zalecane do użytku przez Ministerstwo Edukacji Narodowej i które trafiły już do domeny publicznej.
+ <h2>{% trans "About us" %}</h2>
+ <p>
+ {% blocktrans %}
+ Internet library with school readings „Wolne Lektury” (<a href="http://wolnelektury.pl">www.wolnelektury.pl</a>) is a project made by Modern Poland Foundation. It started in 2007 and shares school readings, which are recommended by Ministry of National Education and are in public domain.
+ {% endblocktrans %}
</p>
- <p class="see-more"><a href="{% url about_us %}">Zobacz więcej ⇒</a></p>
+ <p class="see-more"><a href="{% url about_us %}">{% trans "See more" %} ⇒</a></p>
</div>
</div>
-{% endblock %}
+{% endblock %}
{% extends "base.html" %}
+{% load i18n %}
{% load catalogue_tags pagination_tags %}
-{% block title %}Wyszukiwanie w WolneLektury.pl{% endblock %}
+{% block title %}{% trans "Search in WolneLektury.pl" %}{% endblock %}
{% block bodyid %}tagged-object-list{% endblock %}
{% breadcrumbs tags %}
<div id="books-list">
- <p>Przepraszamy! Brak wyników spełniających kryteria podane w zapytaniu.</p>
-
- <p>Wyszukiwarka obsługuje takie kryteria jak tytuł, autor, motyw/temat, epoka, rodzaj i gatunek utworu.
- Obecnie nie obsługujemy wyszukiwania fraz w tekstach utworów.</p>
-
+ <p>{% trans "Search of " %}<i>{{ query }}</i> {% trans "did not match any resources." %}</p>
++
++ <p>{% transblock %}Search engine supports following criteria: title, author, theme/topic, epoch, kind and genre.
++ As for now we do not support full text search.{% endtransblock %}</p>
{% include "info/join_us.html" %}
</div>
<div id="set-window">
- <div class="header"><a href="#" class="jqmClose">Zamknij</a></div>
+ <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
<div class="target">
- <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
- <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> Ładowanie</p>
++ <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
</div>
</div>
{% endblock %}
{% if shelf_is_set and not object_list %}
<div id="books-list">
- <h2>Twoja półka jest pusta</h2>
- <p>Możesz wrzucić książkę na półkę, wchodząc na stronę danej lektury i klikając na przycisk „Na półkę!”.</p>
+ <h2>{% trans "Your shelf is empty" %}</h2>
+ <p>{% trans "You can put a book on a shelf by entering page of the reading and clicking 'Put on the shelf'." %}</p>
</div>
{% else %}
{% autopaginate object_list 10 %}
{{ last_tag.description|safe }}
</div>
<div class="clearboth"></div>
- <div id="toggle-description"><p>Zwiń opis ▲</p></div>
+ <div id="toggle-description"><p>{% trans "Toggle description" %} ▲</p></div>
{% endif %}
{% if shelf_is_set %}
<a id="download-shelf" href="{% url download_shelf last_tag.slug %}">
- Pobierz wszystkie książki z tej półki
+ {% trans "Download all books from this shelf" %}
</a>
<div id="download-shelf-menu" style="display:none;">
<form action="{% url download_shelf last_tag.slug %}" method="get" accept-charset="utf-8" id="download-formats-form" data-formats-feed="{% url shelf_book_formats last_tag.slug %}">
- <p>{% trans "Choose books' which you want to download:" %}</p>
- <p>Wybierz formaty książek, które chcesz pobrać:</p>
- <li data-format="pdf"><label for="id_formats_2"><input type="checkbox" name="formats" value="pdf" id="id_formats_2" /> PDF</label> <em><strong>do czytania</strong> i drukowania przy pomocy <a href="http://get.adobe.com/reader/">Adobe Reader</a></em></li>
- <li data-format="odt"><label for="id_formats_3"><input type="checkbox" name="formats" value="odt" id="id_formats_3" /> ODT</label> <em><strong>do czytania</strong> i edytowania przy pomocy <a href="http://pl.openoffice.org/">OpenOffice.org</a></em></li>
- <li data-format="txt"><label for="id_formats_4"><input type="checkbox" name="formats" value="txt" id="id_formats_4" /> TXT</label> <em><strong>do czytania</strong> na małych ekranach, np. na komórce</em></li>
- <li data-format="mp3"><label for="id_formats_0"><input type="checkbox" name="formats" value="mp3" id="id_formats_0" /> MP3</label> <em><strong>do słuchania</strong> w ulubionym odtwarzaczu MP3</em></li>
- <li data-format="ogg"><label for="id_formats_1"><input type="checkbox" name="formats" value="ogg" id="id_formats_1" /> Ogg Vorbis</label> <em><strong>do słuchania</strong> — otwarty format <a href="http://www.vorbis.com/">Fundacji Xiph.Org</a></em></li>
- <li id="download-formats-form-submit-li"><label><input type="submit" name="submit" value="Pobierz" id="download-formats-form-submit" disabled="disabled" /> <img src="{{ STATIC_URL }}img/indicator.gif" /></label> <span id="updating-formats">Uaktualniam listę formatów książek na półce.</span><span id="formats-updated" style="display:none;">lub <a href="#" id="download-formats-form-cancel">anuluj</a></span></li>
++ <p>{% trans "Choose books' formats which you want to download:" %}</p>
+ <li data-format="pdf"><label for="id_formats_2"><input type="checkbox" name="formats" value="pdf" id="id_formats_2" /> PDF</label> <em><strong>{% trans "for reading" %}</strong> {% trans "and printing using" %} <a href="http://get.adobe.com/reader/">Adobe Reader</a></em></li>
+ <li data-format="odt"><label for="id_formats_3"><input type="checkbox" name="formats" value="odt" id="id_formats_3" /> ODT</label> <em><strong>{% trans "for reading" %}</strong> {% trans "and editing using" %} <a href="http://pl.openoffice.org/">OpenOffice.org</a></em></li>
+ <li data-format="txt"><label for="id_formats_4"><input type="checkbox" name="formats" value="txt" id="id_formats_4" /> TXT</label> <em><strong>{% trans "for reading" %}</strong> {% trans "on small displays, for example mobile phones" %}</em></li>
+ <li data-format="mp3"><label for="id_formats_0"><input type="checkbox" name="formats" value="mp3" id="id_formats_0" /> MP3</label> <em><strong>{% trans "for listening" %}</strong> {% trans "on favourite MP3 player" %}</em></li>
+ <li data-format="ogg"><label for="id_formats_1"><input type="checkbox" name="formats" value="ogg" id="id_formats_1" /> Ogg Vorbis</label> <em><strong>{% trans "for listening" %}</strong> — {% trans "open format" %} <a href="http://www.vorbis.com/">{% trans "Xiph.org Foundation" %}</a></em></li>
- <li id="download-formats-form-submit-li"><label><input type="submit" name="submit" value="{% trans "Download" %}" id="download-formats-form-submit" disabled="disabled" /> <img src="/static/img/indicator.gif" /></label> <span id="updating-formats">{% trans "Updating list of books' formats on the shelf" %}</span><span id="formats-updated" style="display:none;">{% trans "or" %} <a href="#" id="download-formats-form-cancel">{% trans "cancel" %}</a></span></li>
++ <li id="download-formats-form-submit-li"><label><input type="submit" name="submit" value="{% trans "Download" %}" id="download-formats-form-submit" disabled="disabled" /> <img src="{{ STATIC_URL }}img/indicator.gif" /></label> <span id="updating-formats">{% trans "Updating list of books' formats on the shelf" %}</span><span id="formats-updated" style="display:none;">{% trans "or" %} <a href="#" id="download-formats-form-cancel">{% trans "cancel" %}</a></span></li>
<div class="clearboth"></div>
</form>
</div>
{% endif %}
{% if last_tag.gazeta_link %}
<p><a href="{{ last_tag.gazeta_link }}">
- {% ifequal last_tag.category "author" %}Przeczytaj omówienia utworów autora w serwisie Lektury.Gazeta.pl{% endifequal %}
- {% ifequal last_tag.category "epoch" %}Przeczytaj omówienia z epoki {{ last_tag }} w serwisie Lektury.Gazeta.pl{% endifequal %}
+ {% ifequal last_tag.category "author" %}
+ {% trans "Read work's study of this author on Lektury.Gazeta.pl" %}
+ {% endifequal %}
+ {% ifequal last_tag.category "epoch" %}
+ {% trans "Read study of epoch" %} {{ last_tag }} {% trans "on Lektury.Gazeta.pl" %}
+ {% endifequal %}
</a></p>
{% endif %}
{% if last_tag.wiki_link %}
<p><a href="{{ last_tag.wiki_link }}">
- {% ifequal last_tag.category "author" %}Przeczytaj artykuł o autorze w Wikipedii{% endifequal %}
- {% ifequal last_tag.category "epoch" %}Przeczytaj artykuł o epoce {{ last_tag }} w Wikipedii{% endifequal %}
+ {% ifequal last_tag.category "author" %}
+ {% trans "Read article about this author on Wikipedia" %}
+ {% endifequal %}
+ {% ifequal last_tag.category "epoch" %}
+ {% trans "Read article about epoch" %} {{ last_tag }} {% trans "on Wikipedia" %}
+ {% endifequal %}
</a></p>
{% endif %}
{% for book in object_list %}
<li>
{% if user_is_owner %}
- <a href="{% url remove_from_shelf last_tag.slug book.slug %}" class="remove-from-shelf">Usuń</a>
+ <a href="{% url remove_from_shelf last_tag.slug book.slug %}" class="remove-from-shelf">{% trans "Delete" %}</a>
{% endif %}
{{ book.short_html }}</li>
{% endfor %}
{% else %}
{% if only_author %}
{% if last_tag.alive %}
- <p>Dzieła tego autora objęte są prawem autorskim.</p>
- <p>Dowiedz się, dlaczego biblioteki internetowe
- nie mogą udostępniać dzieł tego autora.</p>
- {% else %}{% comment %} Nie żyje {% endcomment %}
+ {% trans "This author's works are copyrighted." %}
+ {% else %}{% comment %} Is dead {% endcomment %}
{% if last_tag.in_pd %}
- {% trans "This author's works are in public domain and will be published on Internet school library of Wolne Lektury soon." %}
- {% else %}{% comment %} Is dead, but not yet in public domain {% endcomment %}
- <p>Dzieła tego autora znajdują się w domenie publicznej
- i niedługo zostaną opublikowane w szkolnej bibliotece
- internetowej Wolne Lektury.</p>
- {% else %}{% comment %} Nie żyje, ale jeszcze nie w PD {% endcomment %}
++ <p>{% trans "This author's works are in public domain and will be published on Internet school library of Wolne Lektury soon." %}</p>
++ {% else %}
++ {% comment %} Is dead, but not yet in public domain {% endcomment %}
<div>
- <p>Dzieła tego autora przejdą do zasobów domeny
- publicznej i będą mogły być publikowane bez
- żadnych ograniczeń za:</p>
+ <p>{% trans "This author's works will become part of public domain and will be allowed to be published without restrictions in:" %}</p>
{% include "catalogue/pd_counter.html" %}
+ <p>Dowiedz się, dlaczego biblioteki internetowe
+ nie mogą udostępniać dzieł tego autora.</p>
</div>
{% endif %}
{% endif %}
{% else %}
- Nie znaleziono żadnych utworów.
+ {% trans "No works of this author found." %}
{% endif %}
{% include "info/join_us.html" %}
{% endif %}
{% paginate %}
</div>
{% if object_list %}
- {% comment %} Jeśli nic nie znaleźliśmy, to i po prawej stronie nic nie będzie {% endcomment %}
+ {% comment %} If we didn't find anything there will be nothing on the right side as well {% endcomment %}
<div id="tags-list">
<div id="categories-list">
{% if categories.author %}
- <h2>Autorzy</h2>
+ <h2>{% trans "Authors" %}</h2>
{% tag_list categories.author tags %}
{% endif %}
{% if categories.kind %}
- <h2>Rodzaje</h2>
+ <h2>{% trans "Kinds" %}</h2>
{% tag_list categories.kind tags %}
{% endif %}
{% if categories.genre %}
- <h2>Gatunki literackie</h2>
+ <h2>{% trans "Genres" %}</h2>
{% tag_list categories.genre tags %}
{% endif %}
{% if categories.epoch %}
- <h2>Epoki</h2>
+ <h2>{% trans "Epochs" %}</h2>
{% tag_list categories.epoch tags %}
{% endif %}
</div>
<div id="themes-list">
{% if categories.theme %}
- <h2>Motywy</h2>
+ <h2>{% trans "Themes" %}</h2>
{% tag_list categories.theme tags %}
{% endif %}
</div>
{% endif %}
{% endif %}
<div id="set-window">
- <div class="header"><a href="#" class="jqmClose">Zamknij</a></div>
+ <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
<div class="target">
- <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
- <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> Ładowanie</p>
++ <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
</div>
</div>
{% endblock %}