X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FTwig%2FWallabagExtension.php;h=a305c53fc1819a50733746578b9bd30792ab66ef;hb=f3b637fbfee2fa9f66e53cbadd05e85771eece9d;hp=783cde3e70897aedb877f45f8ad0562a5b68cc9b;hpb=bfb3ae01dafa921505384c5db1cd6625ecdd0bb8;p=github%2Fwallabag%2Fwallabag.git 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 $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), ]);