Merge pull request #758 from getgrav/feature/load-twig-intl-extension

Add twig/extensions to allow Twig dates translation
This commit is contained in:
Andy Miller
2016-04-06 17:39:01 -06:00
2 changed files with 7 additions and 1 deletions

View File

@@ -26,7 +26,8 @@
"maximebf/debugbar": "~1.10",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-curl": "*"
"ext-curl": "*",
"twig/extensions": "^1.3"
},
"require-dev": {
"codeception/codeception": "^2.1",

View File

@@ -144,6 +144,11 @@ class Twig
}
$this->twig->addExtension(new TwigExtension());
// enable the Intl Twig extension if translations are enabled
if (count($config->get('system.languages.supported', [])) > 0) {
$this->twig->addExtension(new \Twig_Extensions_Extension_Intl());
}
$this->grav->fireEvent('onTwigExtensions');
// Set some standard variables for twig