diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-10-08 08:55:30 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-10-11 10:43:19 +0200 |
commit | b1428a1cf8cad5002b51d97271da66c67aa3638a (patch) | |
tree | 4ec9ccbc06ede10221501d3aa871388c91cd41fb /src/Wallabag/CoreBundle/Helper | |
parent | d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862 (diff) | |
download | wallabag-b1428a1cf8cad5002b51d97271da66c67aa3638a.tar.gz wallabag-b1428a1cf8cad5002b51d97271da66c67aa3638a.tar.zst wallabag-b1428a1cf8cad5002b51d97271da66c67aa3638a.zip |
Translated first page of exported article
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/EntriesExport.php | 9 |
1 files changed, 7 insertions, 2 deletions
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; | |||
8 | use PHPePub\Core\EPub; | 8 | use PHPePub\Core\EPub; |
9 | use PHPePub\Core\Structure\OPF\DublinCore; | 9 | use PHPePub\Core\Structure\OPF\DublinCore; |
10 | use Symfony\Component\HttpFoundation\Response; | 10 | use Symfony\Component\HttpFoundation\Response; |
11 | use Symfony\Component\Translation\TranslatorInterface; | ||
11 | use Wallabag\CoreBundle\Entity\Entry; | 12 | use Wallabag\CoreBundle\Entity\Entry; |
12 | 13 | ||
13 | /** | 14 | /** |
@@ -17,6 +18,7 @@ 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'; |
@@ -30,10 +32,11 @@ class EntriesExport | |||
30 | * @param string $wallabagUrl Wallabag instance url | 32 | * @param string $wallabagUrl Wallabag instance url |
31 | * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE | 33 | * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE |
32 | */ | 34 | */ |
33 | public function __construct($wallabagUrl, $logoPath) | 35 | public function __construct($wallabagUrl, $logoPath, TranslatorInterface $translator) |
34 | { | 36 | { |
35 | $this->wallabagUrl = $wallabagUrl; | 37 | $this->wallabagUrl = $wallabagUrl; |
36 | $this->logoPath = $logoPath; | 38 | $this->logoPath = $logoPath; |
39 | $this->translator = $translator; | ||
37 | } | 40 | } |
38 | 41 | ||
39 | /** | 42 | /** |
@@ -451,7 +454,9 @@ class EntriesExport | |||
451 | */ | 454 | */ |
452 | private function getExportInformation($type) | 455 | private function getExportInformation($type) |
453 | { | 456 | { |
454 | $info = str_replace('%EXPORT_METHOD%', $type, $this->footerTemplate); | 457 | $info = $this->translator->trans('export.footer_template', [ |
458 | '%method%' => $type, | ||
459 | ]); | ||
455 | 460 | ||
456 | if ('tcpdf' === $type) { | 461 | if ('tcpdf' === $type) { |
457 | return str_replace('%IMAGE%', '<img src="' . $this->logoPath . '" />', $info); | 462 | return str_replace('%IMAGE%', '<img src="' . $this->logoPath . '" />', $info); |