From: Lukasz Date: Tue, 11 May 2010 13:38:25 +0000 (+0200) Subject: Merge branch 'master' of http://github.com/fnp/wolnelektury X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/aff5def884b3e0aeaafd7de454b68b4daa2c4f3d?hp=a36f7ed0eb01683ad672dd712836b5313af76422 Merge branch 'master' of github.com/fnp/wolnelektury --- diff --git a/README.md b/README.md index 3b3f03322..cfc289a77 100644 --- a/README.md +++ b/README.md @@ -40,13 +40,20 @@ How to deploy (development version) ./wolnelektury/manage.py syncdb ./wolnelektury/manage.py migrate - -5. Import some books which are availble on http://www.wolnelektury.pl or on bitbucket mirror: http://bitbucket.org/lqc/wlbooks/ -6. Run the server +5. Run the server ./wolnelektury/manage.py runserver + +6. Import some books which are available on http://www.wolnelektury.pl or on bitbucket mirror: http://bitbucket.org/lqc/wlbooks/ + If you use Bitbucket, you also need Mercurial to fetch books (you can install it using: pip install mercurial). + After downloading books, log into administration, go to Books and choose 'Browse' to select book file, + then fire 'Import book' to upload it. Some books have invalid XML, so you can get an error + (just ignore it and look for other books). + + + Full list of used open-source software ====================================== @@ -131,4 +138,4 @@ Authors ======= * Marek Stępniowski - * Łukasz Rekucki \ No newline at end of file + * Łukasz Rekucki diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index 160167ef2..654dbfb21 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -42,7 +42,7 @@ class JSONFormField(forms.CharField): loads(value) return value except ValueError, e: - raise forms.ValidationError('Enter a valid JSON value. Error: %s' % e) + raise forms.ValidationError(_('Enter a valid JSON value. Error: %s') % e) class JSONField(models.TextField): diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index b040ef911..076282bf4 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -3,6 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms +from django.utils.translation import ugettext_lazy as _ from slughifi import slughifi from catalogue.models import Tag, Book @@ -24,7 +25,7 @@ class SearchForm(forms.Form): def __init__(self, *args, **kwargs): tags = kwargs.pop('tags', []) super(SearchForm, self).__init__(*args, **kwargs) - self.fields['q'].widget.attrs['title'] = u'tytuł, autor, motyw/temat, epoka, rodzaj, gatunek' + self.fields['q'].widget.attrs['title'] = _('title, author, theme/topic, epoch, kind, genre') self.fields['tags'].initial = '/'.join(tag.slug for tag in Tag.get_tag_list(tags)) @@ -40,7 +41,7 @@ class ObjectSetsForm(forms.Form): def __init__(self, obj, user, *args, **kwargs): super(ObjectSetsForm, self).__init__(*args, **kwargs) self.fields['set_ids'] = forms.MultipleChoiceField( - label=u'Półki', + label=_('Shelves'), required=False, choices=[(tag.id, "%s (%s)" % (tag.name, tag.book_count)) for tag in Tag.objects.filter(category='set', user=user)], initial=[tag.id for tag in obj.tags.filter(category='set', user=user)], @@ -53,7 +54,7 @@ class NewSetForm(forms.Form): def __init__(self, *args, **kwargs): super(NewSetForm, self).__init__(*args, **kwargs) - self.fields['name'].widget.attrs['title'] = u'nazwa nowej półki' + self.fields['name'].widget.attrs['title'] = _('Name of the new shelf') def save(self, user, commit=True): name = self.cleaned_data['name'] diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index b760eccc2..59011fd9b 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -138,7 +138,7 @@ class Book(models.Model): formats = [] if self.html_file: - formats.append(u'Czytaj online' % reverse('book_text', kwargs={'slug': self.slug})) + formats.append(u'%s' % (reverse('book_text', kwargs={'slug': self.slug}), _('Read online'))) if self.pdf_file: formats.append(u'PDF' % self.pdf_file.url) if self.odt_file: @@ -218,7 +218,7 @@ class Book(models.Model): book_shelves = [] else: if not overwrite: - raise Book.AlreadyExists('Book %s already exists' % book_slug) + raise Book.AlreadyExists(_('Book %s already exists') % book_slug) # Save shelves for this book book_shelves = list(book.tags.filter(category='set')) @@ -261,7 +261,7 @@ class Book(models.Model): child_book.parent_number = n child_book.save() except Book.DoesNotExist, e: - raise Book.DoesNotExist(u'Book with slug = "%s" does not exist.' % slug) + raise Book.DoesNotExist(_('Book with slug = "%s" does not exist.') % slug) book_descendants = list(book.children.all()) while len(book_descendants) > 0: @@ -383,5 +383,4 @@ class BookStub(models.Model): class Meta: ordering = ('title',) verbose_name = _('book stub') - verbose_name_plural = _('book stubs') - + verbose_name_plural = _('book stubs') \ No newline at end of file diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index b4fb0924c..7cbba2748 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -260,7 +260,7 @@ def book_sets(request, slug): book_sets = book.tags.filter(category='set', user=request.user) if not request.user.is_authenticated(): - return HttpResponse('

Aby zarządzać swoimi półkami, musisz się zalogować.

') + return HttpResponse(_('

To maintain your shelves you need to be logged in.

')) if request.method == 'POST': form = forms.ObjectSetsForm(book, request.user, request.POST) @@ -278,7 +278,7 @@ def book_sets(request, slug): book.tags = new_shelves + list(book.tags.filter(~Q(category='set') | ~Q(user=request.user))) if request.is_ajax(): - return HttpResponse('

Półki zostały zapisane.

') + return HttpResponse(_('

Shelves were sucessfully saved.

')) else: return HttpResponseRedirect('/') else: @@ -302,9 +302,9 @@ def remove_from_shelf(request, shelf, book): 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): @@ -337,7 +337,7 @@ def download_shelf(request, slug): 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)): @@ -400,7 +400,7 @@ def new_set(request): new_set = new_set_form.save(request.user) if request.is_ajax(): - return HttpResponse(u'

Półka %s została utworzona

' % new_set) + return HttpResponse(_('

Shelf %s was successfully created

') % new_set) else: return HttpResponseRedirect('/') @@ -415,7 +415,7 @@ def delete_shelf(request, slug): user_set.delete() if request.is_ajax(): - return HttpResponse(u'

Półka %s została usunięta

' % user_set.name) + return HttpResponse(_('

Shelf %s was successfully removed

') % user_set.name) else: return HttpResponseRedirect('/') @@ -474,10 +474,10 @@ def import_book(request): 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) @@ -486,4 +486,4 @@ def clock(request): 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')) \ No newline at end of file diff --git a/apps/lessons/models.py b/apps/lessons/models.py index b3c79d71c..dc113ed16 100644 --- a/apps/lessons/models.py +++ b/apps/lessons/models.py @@ -8,7 +8,7 @@ from django.utils.translation import ugettext_lazy as _ from os import path class Document(models.Model): - """Dokument - materiał pomocniczy dla nauczycieli.""" + """Document - hand-out for teachers""" title = models.CharField(_('title'), max_length=120) slug = models.SlugField(_('slug')) file = models.FileField(_('file'), upload_to='lessons/document') diff --git a/wolnelektury/static/js/jquery.countdown-pl.js b/wolnelektury/static/js/jquery.countdown-pl.js index 4d6d1d44c..10f84d41e 100644 --- a/wolnelektury/static/js/jquery.countdown-pl.js +++ b/wolnelektury/static/js/jquery.countdown-pl.js @@ -19,4 +19,4 @@ } }; $.countdown.setDefaults($.countdown.regional['pl']); -})(jQuery); +})(jQuery); \ No newline at end of file diff --git a/wolnelektury/static/js/jquery.countdown.js b/wolnelektury/static/js/jquery.countdown.js index 11d550612..06f612520 100644 --- a/wolnelektury/static/js/jquery.countdown.js +++ b/wolnelektury/static/js/jquery.countdown.js @@ -6,7 +6,7 @@ Please attribute the author if you use it. */ /* Modified by Radek Czajka, Fundacja Nowoczesna Polska (radoslaw.czajka(at)nowoczesnapolska.org.pl) */ -w + /* Display a countdown timer. Attach it with options like: $('div selector').countdown( diff --git a/wolnelektury/templates/404.html b/wolnelektury/templates/404.html index b4968a248..288e050ed 100644 --- a/wolnelektury/templates/404.html +++ b/wolnelektury/templates/404.html @@ -14,7 +14,7 @@

{% trans "Site does not exist" %}

-{% trans "We are sorry, but this site does not exist. Please check if you entered correct address or go to "%} {% trans "homepage" %}. +{% trans "We are sorry, but this site does not exist. Please check if you entered correct address or go to "%} {% trans "main page" %}.

- + \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index f4363539f..c249fa5a9 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -2,14 +2,14 @@ {% 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 %}

{{ book.title }}, {{ categories.author|join:", " }}

-

{{ form.q }} {% trans "or" %} {% trans "return to homepage" %}

+

{{ form.q }} {% trans "or" %} {% trans "return to main page" %}

diff --git a/wolnelektury/templates/catalogue/book_list.html b/wolnelektury/templates/catalogue/book_list.html index 281e5e73d..3e6a9c555 100644 --- a/wolnelektury/templates/catalogue/book_list.html +++ b/wolnelektury/templates/catalogue/book_list.html @@ -4,10 +4,10 @@ {% block bodyid %}book-a-list{% endblock %} -{% block title %}{% trans "Alphabetical listing of works on" %}Alfabetyczny spis utworów w WolneLektury.pl{% endblock %} +{% block title %}{% trans "Alphabetical listing of works on WolneLektury.pl" %}{% endblock %} {% block body %} -

Alfabetyczny spis utworów

+

{% trans "Alphabetical listing of works" %}

{{ form.q }} {% trans "or" %} {% trans "return to main page" %}

diff --git a/wolnelektury/templates/catalogue/book_short.html b/wolnelektury/templates/catalogue/book_short.html index 2cc8328f5..8b36718e0 100644 --- a/wolnelektury/templates/catalogue/book_short.html +++ b/wolnelektury/templates/catalogue/book_short.html @@ -15,4 +15,4 @@ {% endif %}

{% trans "Categories" %}: {{ tags|join:", " }}

- + \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_stub_detail.html b/wolnelektury/templates/catalogue/book_stub_detail.html index 5037ecb8f..9ed3a8b10 100644 --- a/wolnelektury/templates/catalogue/book_stub_detail.html +++ b/wolnelektury/templates/catalogue/book_stub_detail.html @@ -1,37 +1,35 @@ {% 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 %}

{{ book.title }}, {{ book.author }}

-

{{ form.q }} lub wróć do strony głównej

+

{{ form.q }} {% trans "or" %} {% trans "return to main page" %}

{% 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" %}
- +
-

* Ładowanie

+

* {% trans "Loading" %}

{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_text.html b/wolnelektury/templates/catalogue/book_text.html index 55eef8ebd..39934f859 100644 --- a/wolnelektury/templates/catalogue/book_text.html +++ b/wolnelektury/templates/catalogue/book_text.html @@ -14,7 +14,7 @@ diff --git a/wolnelektury/templates/catalogue/fragment_short.html b/wolnelektury/templates/catalogue/fragment_short.html index 24eeef336..ccca721de 100644 --- a/wolnelektury/templates/catalogue/fragment_short.html +++ b/wolnelektury/templates/catalogue/fragment_short.html @@ -1,8 +1,5 @@ {% load i18n %}
- {#
#} - {# Półki #} - {#
#} {% if fragment.short_text %}
{{ fragment.short_text|safe }} diff --git a/wolnelektury/templates/catalogue/main_page.html b/wolnelektury/templates/catalogue/main_page.html index be6d9004f..15667500b 100644 --- a/wolnelektury/templates/catalogue/main_page.html +++ b/wolnelektury/templates/catalogue/main_page.html @@ -265,15 +265,18 @@

{% trans "You can help us!" %}

-

{% 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.

-

Zapraszamy wszystkie osoby, które chcą współtworzyć szkolną bibliotekę internetową Wolne Lektury.

-

Zobacz więcej ⇒

+

{% trans "We try our best to elaborate works appended to our library. It is possible only due to support of our volunteers." %}

+

{% trans "We invite people who want to take part in developing Internet school library Wolne Lektury." %}

+

{% trans "See more" %} ⇒

-

O projekcie

-

Biblioteka internetowa z lekturami szkolnymi „Wolne Lektury” (www.wolnelektury.pl) 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. +

{% trans "About us" %}

+

+ {% blocktrans %} + Internet library with school readings „Wolne Lektury” (www.wolnelektury.pl) 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 %}

-

Zobacz więcej ⇒

+

{% trans "See more" %} ⇒

-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/search_no_hits.html b/wolnelektury/templates/catalogue/search_no_hits.html index 8e4e788a4..b2a71c8c0 100644 --- a/wolnelektury/templates/catalogue/search_no_hits.html +++ b/wolnelektury/templates/catalogue/search_no_hits.html @@ -1,7 +1,8 @@ {% 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 %} @@ -10,14 +11,14 @@ {% breadcrumbs tags %}
-

Wyszukiwanie {{ query }} nie dało rezultatu.

+

{% trans "Search of " %}{{ query }} {% trans "did not match any resources." %}

{% include "info/join_us.html" %}
- +
-

* Ładowanie

+

* {% trans "Loading" %}

{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/tag_list.html b/wolnelektury/templates/catalogue/tag_list.html index aa273c860..e96320e90 100644 --- a/wolnelektury/templates/catalogue/tag_list.html +++ b/wolnelektury/templates/catalogue/tag_list.html @@ -1,7 +1,7 @@ {% load i18n %} {% load catalogue_tags %} {% if one_tag %} -

Zobacz całą kategorię {{ one_tag }}

+

{% trans "See full category" %} {{ one_tag }}

{% else %}