|
@@ -33,6 +33,16 @@ class TransExtension extends \Twig_Extension
|
|
return $this->translator;
|
|
return $this->translator;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * {@inheritdoc}
|
|
|
|
+ */
|
|
|
|
+ public function getFilters()
|
|
|
|
+ {
|
|
|
|
+ return array(
|
|
|
|
+ 'trans' => new \Twig_Filter_Method($this, 'trans'),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Returns the token parser instance to add to the existing list.
|
|
* Returns the token parser instance to add to the existing list.
|
|
*
|
|
*
|
|
@@ -51,6 +61,11 @@ class TransExtension extends \Twig_Extension
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function trans($message, array $arguments = array(), $domain = "messages")
|
|
|
|
+ {
|
|
|
|
+ return $this->translator->trans($message, $arguments, $domain);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Returns the name of the extension.
|
|
* Returns the name of the extension.
|
|
*
|
|
*
|