From b1428a1cf8cad5002b51d97271da66c67aa3638a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 8 Oct 2017 08:55:30 +0200 Subject: Translated first page of exported article --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 838b9734..3e1cd522 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -8,6 +8,7 @@ use JMS\Serializer\SerializerBuilder; use PHPePub\Core\EPub; use PHPePub\Core\Structure\OPF\DublinCore; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Translation\TranslatorInterface; use Wallabag\CoreBundle\Entity\Entry; /** @@ -17,6 +18,7 @@ class EntriesExport { private $wallabagUrl; private $logoPath; + private $translator; private $title = ''; private $entries = []; private $author = 'wallabag'; @@ -30,10 +32,11 @@ class EntriesExport * @param string $wallabagUrl Wallabag instance url * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE */ - public function __construct($wallabagUrl, $logoPath) + public function __construct($wallabagUrl, $logoPath, TranslatorInterface $translator) { $this->wallabagUrl = $wallabagUrl; $this->logoPath = $logoPath; + $this->translator = $translator; } /** @@ -451,7 +454,9 @@ class EntriesExport */ private function getExportInformation($type) { - $info = str_replace('%EXPORT_METHOD%', $type, $this->footerTemplate); + $info = $this->translator->trans('export.footer_template', [ + '%method%' => $type, + ]); if ('tcpdf' === $type) { return str_replace('%IMAGE%', '', $info); -- cgit v1.2.3