From 34acb02cbbc700f0d73ac340e906d3179932ab2b Mon Sep 17 00:00:00 2001 From: tcit Date: Wed, 7 May 2014 12:48:46 +0200 Subject: Added translation capabilities for epub system --- inc/poche/Poche.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index c99bfcba..c59973f3 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -1189,10 +1189,10 @@ class Poche $log->logLine("getCurrentServerURL: " . $book->getCurrentServerURL()); $log->logLine("getCurrentPageURL..: " . $book->getCurrentPageURL()); - $book->setTitle("wallabag's articles"); + $book->setTitle(_('wallabag\'s articles')); $book->setIdentifier("http://$_SERVER[HTTP_HOST]", EPub::IDENTIFIER_URI); // Could also be the ISBN number, prefered for published books, or a UUID. //$book->setLanguage("en"); // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc. - $book->setDescription("Some articles saved on my wallabag"); + $book->setDescription(_("Some articles saved on my wallabag")); $book->setAuthor("wallabag","wallabag"); $book->setPublisher("wallabag","wallabag"); // I hope this is a non existant address :) $book->setDate(time()); // Strictly not needed as the book date defaults to time(). @@ -1206,16 +1206,16 @@ class Poche $log->logLine("Add Cover"); if (count($entries)>1){ - $cover = "

" . $entries[0]['title'] . " and " . count($entries) . " other articles

"; + $cover = sprintf(_('

%s and %s other articles

'), $entries[0]['title'], count($entries)); } else { - $cover = "

" . $entries[0]['title'] . "

"; + $cover = sprintf(_('

%s

'), $entries[0]['title']); } $book->setCover("Cover.png", file_get_contents("themes/baggy/img/apple-touch-icon-152.png"), "image/png", $cover); $book->setCover($cover); //$book->addChapter("Notices", "Cover.html", $cover); - $book->buildTOC(NULL, "toc", "Table of Contents", TRUE, TRUE); + $book->buildTOC(NULL, "toc", _('Table of Contents'), TRUE, TRUE); $subject = ""; foreach ($entries as $entry) { @@ -1239,6 +1239,6 @@ class Poche //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n" . $bookEnd); } $book->finalize(); - $zipData = $book->sendBook("wallabag's articles"); + $zipData = $book->sendBook(_('wallabag\'s articles')); } } -- cgit v1.2.3