Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
Ignore the IdentityTranslator so that the texts are translated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
sroze committed Aug 19, 2018
1 parent 2c1a865 commit a494c63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Twig/Extensions/Extension/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* file that was distributed with this source code.
*/
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Translation\IdentityTranslator;

/**
* @author Robin van der Vleuten <robinvdvleuten@gmail.com>
Expand All @@ -31,6 +32,11 @@ class Twig_Extensions_Extension_Date extends Twig_Extension

public function __construct(TranslatorInterface $translator = null)
{
// Ignore the IdentityTranslator, otherwise the parameters won't be replaced properly
if ($translator instanceof IdentityTranslator) {
$translator = null;
}

$this->translator = $translator;
}

Expand Down

0 comments on commit a494c63

Please sign in to comment.