aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-10-21 15:15:41 +0200
committerGitHub <noreply@github.com>2016-10-21 15:15:41 +0200
commitf99ddbc6f82b0e5619d51ec4415738bf34d350b6 (patch)
tree1aab7d493dcb8fe79f19d612ef62f7d8e58f597f /src/Wallabag/CoreBundle/Twig/WallabagExtension.php
parent49dee2d2de63af36248e92ce740da2692358280e (diff)
parentb64d8f2c9f4092b43da5f4a978028d80d9ee81a8 (diff)
downloadwallabag-f99ddbc6f82b0e5619d51ec4415738bf34d350b6.tar.gz
wallabag-f99ddbc6f82b0e5619d51ec4415738bf34d350b6.tar.zst
wallabag-f99ddbc6f82b0e5619d51ec4415738bf34d350b6.zip
Merge pull request #2481 from wallabag/some-fixes
Some fixes
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig/WallabagExtension.php')
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
index 783cde3e..a305c53f 100644
--- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
+++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
@@ -138,8 +138,11 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
138 $interval = $user->getCreatedAt()->diff(new \DateTime('now')); 138 $interval = $user->getCreatedAt()->diff(new \DateTime('now'));
139 $nbDays = (int) $interval->format('%a') ?: 1; 139 $nbDays = (int) $interval->format('%a') ?: 1;
140 140
141 // force setlocale for date translation
142 setlocale(LC_TIME, strtolower($user->getConfig()->getLanguage()).'_'.strtoupper(strtolower($user->getConfig()->getLanguage())));
143
141 return $this->translator->trans('footer.stats', [ 144 return $this->translator->trans('footer.stats', [
142 '%user_creation%' => $user->getCreatedAt()->format('F jS, Y'), 145 '%user_creation%' => strftime('%e %B %Y', $user->getCreatedAt()->getTimestamp()),
143 '%nb_archives%' => $nbArchives, 146 '%nb_archives%' => $nbArchives,
144 '%per_day%' => round($nbArchives / $nbDays, 2), 147 '%per_day%' => round($nbArchives / $nbDays, 2),
145 ]); 148 ]);