From e47d97fdd290dc51a32cd84ce93aade29da56e36 Mon Sep 17 00:00:00 2001
From: Lukasz <lukasz@anwajler.com>
Date: Tue, 11 May 2010 13:56:22 +0200
Subject: [PATCH] Further i18n implementation.

---
 apps/catalogue/models.py                       |  9 ++++-----
 wolnelektury/static/js/jquery.countdown-pl.js  |  2 +-
 wolnelektury/static/js/jquery.countdown.js     |  2 +-
 .../templates/catalogue/book_detail.html       |  4 ++--
 .../templates/catalogue/book_stub_detail.html  | 18 ++++++++----------
 .../templates/catalogue/book_text.html         |  2 +-
 .../templates/catalogue/search_no_hits.html    |  9 +++++----
 .../catalogue/tagged_object_list.html          |  4 ++--
 .../templates/lessons/document_detail.html     |  2 +-
 9 files changed, 25 insertions(+), 27 deletions(-)

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'<a href="%s">Czytaj online</a>' % reverse('book_text', kwargs={'slug': self.slug}))
+                formats.append(u'<a href="%s">%s</a>' % (reverse('book_text', kwargs={'slug': self.slug}), _('Read online')))
             if self.pdf_file:
                 formats.append(u'<a href="%s">PDF</a>' % 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/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/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html
index 03b46bc7b..6b36c955c 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 %}
     <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">
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 %}
     <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="*"/> Ładowanie</p>
+            <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
         </div>
     </div>
 {% 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 @@
     <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>
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 %}
     
     <div id="books-list">
-        <p>Wyszukiwanie <i>{{ query }}</i> nie dało rezultatu.</p>
+        <p>{% trans "Search of " %}<i>{{ query }}</i> {% trans "did not match any resources." %}</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="*"/> Ładowanie</p>
+            <p><img src="/static/img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
         </div>
     </div>
 {% endblock %}
\ No newline at end of file
diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html
index b8d091a92..230d8ed34 100644
--- a/wolnelektury/templates/catalogue/tagged_object_list.html
+++ b/wolnelektury/templates/catalogue/tagged_object_list.html
@@ -13,7 +13,7 @@
     {% if shelf_is_set and not object_list %}
     <div id="books-list">
         <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>
+        <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 %}
@@ -113,7 +113,7 @@
                 {% tag_list categories.genre tags %}
             {% endif %}
             {% if categories.epoch %}
-                <h2>{% trans "Epochs" %}Epoki</h2>
+                <h2>{% trans "Epochs" %}</h2>
                 {% tag_list categories.epoch tags %}
             {% endif %}        
         </div>
diff --git a/wolnelektury/templates/lessons/document_detail.html b/wolnelektury/templates/lessons/document_detail.html
index 7c6406c19..afc3d69db 100644
--- a/wolnelektury/templates/lessons/document_detail.html
+++ b/wolnelektury/templates/lessons/document_detail.html
@@ -6,7 +6,7 @@
 {% block body %}
     <h1>{{ object.title }}</h1>
     <form action="{% url search %}" method="GET" accept-charset="utf-8" id="search-form">
-        <p>{{ form.q }} <input type="submit" value="{% trans "Szukaj" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url lessons_document_list %}">{% trans "return to list of materials" %}</a></p>
+        <p>{{ form.q }} <input type="submit" value="{% trans "Search" %}" /> <strong>{% trans "or" %}</strong> <a href="{% url lessons_document_list %}">{% trans "return to list of materials" %}</a></p>
     </form>
     
     <div id="document-detail">
-- 
2.20.1