diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-11 14:48:46 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-20 21:12:22 +0100 |
commit | 4204a06b7726597dc84fe34b39c53f1534a86140 (patch) | |
tree | f81243f621997e9da4c39e4c17f2a2d37053103e /src/Wallabag/ImportBundle/Controller/PocketController.php | |
parent | 4f9cf232f8d4d750d39aca83406b8a6d5e17a6c9 (diff) | |
download | wallabag-4204a06b7726597dc84fe34b39c53f1534a86140.tar.gz wallabag-4204a06b7726597dc84fe34b39c53f1534a86140.tar.zst wallabag-4204a06b7726597dc84fe34b39c53f1534a86140.zip |
Add flashes messages
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/PocketController.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/PocketController.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 7a35514b..1d804219 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php | |||
@@ -52,8 +52,9 @@ class PocketController extends Controller | |||
52 | */ | 52 | */ |
53 | public function callbackAction() | 53 | public function callbackAction() |
54 | { | 54 | { |
55 | $message = 'Import failed, please try again.'; | 55 | $message = 'flashes.import.notice.failed'; |
56 | $pocket = $this->get('wallabag_import.pocket.import'); | 56 | $pocket = $this->get('wallabag_import.pocket.import'); |
57 | |||
57 | $markAsRead = $this->get('session')->get('mark_as_read'); | 58 | $markAsRead = $this->get('session')->get('mark_as_read'); |
58 | $this->get('session')->remove('mark_as_read'); | 59 | $this->get('session')->remove('mark_as_read'); |
59 | 60 | ||
@@ -69,7 +70,10 @@ class PocketController extends Controller | |||
69 | 70 | ||
70 | if (true === $pocket->setMarkAsRead($markAsRead)->import()) { | 71 | if (true === $pocket->setMarkAsRead($markAsRead)->import()) { |
71 | $summary = $pocket->getSummary(); | 72 | $summary = $pocket->getSummary(); |
72 | $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; | 73 | $message = $this->get('translator')->trans('flashes.import.notice.summary', array( |
74 | '%imported%' => $summary['imported'], | ||
75 | '%skipped%' => $summary['skipped'], | ||
76 | )); | ||
73 | } | 77 | } |
74 | 78 | ||
75 | $this->get('session')->getFlashBag()->add( | 79 | $this->get('session')->getFlashBag()->add( |