]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Twig/WallabagExtension.php
Translate date
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Twig / WallabagExtension.php
index 783cde3e70897aedb877f45f8ad0562a5b68cc9b..a305c53fc1819a50733746578b9bd30792ab66ef 100644 (file)
@@ -138,8 +138,11 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
         $interval = $user->getCreatedAt()->diff(new \DateTime('now'));
         $nbDays = (int) $interval->format('%a') ?: 1;
 
+        // force setlocale for date translation
+        setlocale(LC_TIME, strtolower($user->getConfig()->getLanguage()).'_'.strtoupper(strtolower($user->getConfig()->getLanguage())));
+
         return $this->translator->trans('footer.stats', [
-            '%user_creation%' => $user->getCreatedAt()->format('F jS, Y'),
+            '%user_creation%' => strftime('%e %B %Y', $user->getCreatedAt()->getTimestamp()),
             '%nb_archives%' => $nbArchives,
             '%per_day%' => round($nbArchives / $nbDays, 2),
         ]);