From 0bddd348473b0d6ef6884c1e8b0c7533f601b2b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 6 Apr 2020 15:34:32 +0200 Subject: [PATCH] Added publication date on epub export --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 7 +++++++ .../CoreBundle/Resources/translations/messages.da.yml | 1 + .../CoreBundle/Resources/translations/messages.de.yml | 1 + .../CoreBundle/Resources/translations/messages.en.yml | 1 + .../CoreBundle/Resources/translations/messages.es.yml | 1 + .../CoreBundle/Resources/translations/messages.fa.yml | 1 + .../CoreBundle/Resources/translations/messages.fr.yml | 1 + .../CoreBundle/Resources/translations/messages.it.yml | 1 + .../CoreBundle/Resources/translations/messages.ja.yml | 1 + .../CoreBundle/Resources/translations/messages.oc.yml | 1 + .../CoreBundle/Resources/translations/messages.pl.yml | 1 + .../CoreBundle/Resources/translations/messages.pt.yml | 1 + .../CoreBundle/Resources/translations/messages.ro.yml | 1 + .../CoreBundle/Resources/translations/messages.ru.yml | 1 + .../CoreBundle/Resources/translations/messages.th.yml | 1 + .../CoreBundle/Resources/translations/messages.tr.yml | 1 + .../CoreBundle/Resources/translations/messages.zh.yml | 1 + 17 files changed, 23 insertions(+) diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index f981ee50..1318602e 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -196,10 +196,17 @@ class EntriesExport $authors = implode(',', $publishedBy); } + $publishedAt = $entry->getPublishedAt(); + $publishedDate = $this->translator->trans('export.unknown'); + if (!empty($publishedAt)) { + $publishedDate = $entry->getPublishedAt()->format('Y-m-d'); + } + $titlepage = $content_start . '

' . $entry->getTitle() . '

' . '
' . '
' . $this->translator->trans('entry.view.published_by') . '
' . $authors . '
' . + '
' . $this->translator->trans('entry.metadata.published_on') . '
' . $publishedDate . '
' . '
' . $this->translator->trans('entry.metadata.reading_time') . '
' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '
' . '
' . $this->translator->trans('entry.metadata.added_on') . '
' . $entry->getCreatedAt()->format('Y-m-d') . '
' . '
' . $this->translator->trans('entry.metadata.address') . '
' . $entry->getUrl() . '
' . diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 47de066f..53b60c72 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'Om' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 50e67d47..b9694be8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'Über' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 27585f77..e8b1ea15 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% min" address: "Address" added_on: "Added on" + published_on: "Published on" about: page_title: 'About' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 2cf67176..6fd44f8e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% min" address: "Dirección" added_on: "Añadido el" + # published_on: "Published on" about: page_title: 'Acerca de' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index c1fb74d3..627923b0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'درباره' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 2b8bb092..542dc25c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% min" address: "Adresse" added_on: "Ajouté le" + published_on: "Publié le" about: page_title: "À propos" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 8cee3e52..5d017a40 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'A proposito' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml index 9125a5d1..9de8c571 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ja.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% 分" address: "アドレス" added_on: "追加日" + # published_on: "Published on" about: page_title: 'アプリについて' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 052582ab..e0fb1933 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% min" address: "Adreça" added_on: "Ajustat a" + # published_on: "Published on" about: page_title: 'A prepaus' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 93e8f852..dfaf9e89 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'O nas' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 7159569e..8908c0cc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% min" address: "Endereço" added_on: "Adicionado o" + # published_on: "Published on" about: page_title: 'Sobre' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index f671da8d..b269578a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'Despre' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 7d45df1c..648bbc80 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'О' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 03f8fa9a..4de87adc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'เกี่ยวกับ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 05cfbbfc..9afa648c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -285,6 +285,7 @@ entry: # reading_time_minutes_short: "%readingTime% min" # address: "Address" # added_on: "Added on" + # published_on: "Published on" about: page_title: 'Hakkımızda' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml index 21f2f9a7..a34e3852 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.zh.yml @@ -285,6 +285,7 @@ entry: reading_time_minutes_short: "%readingTime% 分钟" address: "地址" added_on: "添加于" + # published_on: "Published on" about: page_title: '关于' -- 2.41.0