mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-27 17:28:39 +00:00
Translated first page of exported article
This commit is contained in:
parent
d8dc7372ab
commit
b1428a1cf8
14 changed files with 44 additions and 2 deletions
|
@ -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%', '<img src="' . $this->logoPath . '" />', $info);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue