aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/EntriesExport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/EntriesExport.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 838b9734..830798b8 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -8,6 +8,7 @@ use JMS\Serializer\SerializerBuilder;
8use PHPePub\Core\EPub; 8use PHPePub\Core\EPub;
9use PHPePub\Core\Structure\OPF\DublinCore; 9use PHPePub\Core\Structure\OPF\DublinCore;
10use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
11use Symfony\Component\Translation\TranslatorInterface;
11use Wallabag\CoreBundle\Entity\Entry; 12use Wallabag\CoreBundle\Entity\Entry;
12 13
13/** 14/**
@@ -17,21 +18,20 @@ class EntriesExport
17{ 18{
18 private $wallabagUrl; 19 private $wallabagUrl;
19 private $logoPath; 20 private $logoPath;
21 private $translator;
20 private $title = ''; 22 private $title = '';
21 private $entries = []; 23 private $entries = [];
22 private $author = 'wallabag'; 24 private $author = 'wallabag';
23 private $language = ''; 25 private $language = '';
24 private $footerTemplate = '<div style="text-align:center;">
25 <p>Produced by wallabag with %EXPORT_METHOD%</p>
26 <p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p>
27 </div>';
28 26
29 /** 27 /**
30 * @param string $wallabagUrl Wallabag instance url 28 * @param TranslatorInterface $translator Translator service
31 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE 29 * @param string $wallabagUrl Wallabag instance url
30 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
32 */ 31 */
33 public function __construct($wallabagUrl, $logoPath) 32 public function __construct(TranslatorInterface $translator, $wallabagUrl, $logoPath)
34 { 33 {
34 $this->translator = $translator;
35 $this->wallabagUrl = $wallabagUrl; 35 $this->wallabagUrl = $wallabagUrl;
36 $this->logoPath = $logoPath; 36 $this->logoPath = $logoPath;
37 } 37 }
@@ -451,7 +451,9 @@ class EntriesExport
451 */ 451 */
452 private function getExportInformation($type) 452 private function getExportInformation($type)
453 { 453 {
454 $info = str_replace('%EXPORT_METHOD%', $type, $this->footerTemplate); 454 $info = $this->translator->trans('export.footer_template', [
455 '%method%' => $type,
456 ]);
455 457
456 if ('tcpdf' === $type) { 458 if ('tcpdf' === $type) {
457 return str_replace('%IMAGE%', '<img src="' . $this->logoPath . '" />', $info); 459 return str_replace('%IMAGE%', '<img src="' . $this->logoPath . '" />', $info);