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 From dc7fa8dfc606a03295a58d797f269f3ed7097939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 8 Oct 2017 11:03:32 +0200 Subject: Fixed @tcitworld's review --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 3e1cd522..f43bc33d 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -23,20 +23,16 @@ class EntriesExport private $entries = []; private $author = 'wallabag'; private $language = ''; - private $footerTemplate = '
-

Produced by wallabag with %EXPORT_METHOD%

-

Please open an issue if you have trouble with the display of this E-Book on your device.

-
'; /** * @param string $wallabagUrl Wallabag instance url * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE */ - public function __construct($wallabagUrl, $logoPath, TranslatorInterface $translator) + public function __construct(TranslatorInterface $translator, $wallabagUrl, $logoPath) { + $this->translator = $translator; $this->wallabagUrl = $wallabagUrl; $this->logoPath = $logoPath; - $this->translator = $translator; } /** -- cgit v1.2.3 From 8f187e280f91910534366bee3973a7e3c76a5627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 8 Oct 2017 20:39:44 +0200 Subject: Fixed @j0k3r's review --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index f43bc33d..06144ea9 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -25,6 +25,7 @@ class EntriesExport private $language = ''; /** + * @param TranslatorInterface $translator Translator service * @param string $wallabagUrl Wallabag instance url * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE */ -- cgit v1.2.3 From 9dd67fa3420c6cfaf7bdae182ca3433c7f636187 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 11 Oct 2017 10:43:36 +0200 Subject: CS --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 06144ea9..830798b8 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -25,9 +25,9 @@ class EntriesExport private $language = ''; /** - * @param TranslatorInterface $translator Translator service - * @param string $wallabagUrl Wallabag instance url - * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE + * @param TranslatorInterface $translator Translator service + * @param string $wallabagUrl Wallabag instance url + * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE */ public function __construct(TranslatorInterface $translator, $wallabagUrl, $logoPath) { -- cgit v1.2.3