aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/Twig/Extensions/Extension/I18n.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-02 22:40:51 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-02 22:40:51 +0200
commita4565e88edbc8e3bd092a475469769c86a4c350c (patch)
treea6a3c935b03a23ff87575c8c315cf8ba78fe68c2 /inc/Twig/Extensions/Extension/I18n.php
parentf6c9baab3efeec1d0efa151e276fc08d5b58f9e9 (diff)
downloadwallabag-a4565e88edbc8e3bd092a475469769c86a4c350c.tar.gz
wallabag-a4565e88edbc8e3bd092a475469769c86a4c350c.tar.zst
wallabag-a4565e88edbc8e3bd092a475469769c86a4c350c.zip
add Twig & refactor poche
Diffstat (limited to 'inc/Twig/Extensions/Extension/I18n.php')
-rw-r--r--inc/Twig/Extensions/Extension/I18n.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/inc/Twig/Extensions/Extension/I18n.php b/inc/Twig/Extensions/Extension/I18n.php
new file mode 100644
index 00000000..3702aa22
--- /dev/null
+++ b/inc/Twig/Extensions/Extension/I18n.php
@@ -0,0 +1,44 @@
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) 2010 Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11class Twig_Extensions_Extension_I18n extends Twig_Extension
12{
13 /**
14 * Returns the token parser instances to add to the existing list.
15 *
16 * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
17 */
18 public function getTokenParsers()
19 {
20 return array(new Twig_Extensions_TokenParser_Trans());
21 }
22
23 /**
24 * Returns a list of filters to add to the existing list.
25 *
26 * @return array An array of filters
27 */
28 public function getFilters()
29 {
30 return array(
31 'trans' => new Twig_Filter_Function('gettext'),
32 );
33 }
34
35 /**
36 * Returns the name of the extension.
37 *
38 * @return string The extension name
39 */
40 public function getName()
41 {
42 return 'i18n';
43 }
44}