You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

I18n.php 1014B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. class Twig_Extensions_Extension_I18n extends Twig_Extension
  11. {
  12. /**
  13. * Returns the token parser instances to add to the existing list.
  14. *
  15. * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
  16. */
  17. public function getTokenParsers()
  18. {
  19. return array(new Twig_Extensions_TokenParser_Trans());
  20. }
  21. /**
  22. * Returns a list of filters to add to the existing list.
  23. *
  24. * @return array An array of filters
  25. */
  26. public function getFilters()
  27. {
  28. return array(
  29. new Twig_SimpleFilter('trans', 'gettext'),
  30. );
  31. }
  32. /**
  33. * Returns the name of the extension.
  34. *
  35. * @return string The extension name
  36. */
  37. public function getName()
  38. {
  39. return 'i18n';
  40. }
  41. }