|
@@ -28,7 +28,7 @@ class TranslatorHelper extends Helper
|
|
|
*
|
|
|
* @param TranslatorInterface $translator A TranslatorInterface instance
|
|
|
*/
|
|
|
- public function __construct(TranslatorInterface $translator = null)
|
|
|
+ public function __construct(TranslatorInterface $translator)
|
|
|
{
|
|
|
$this->translator = $translator;
|
|
|
}
|
|
@@ -38,10 +38,6 @@ class TranslatorHelper extends Helper
|
|
|
*/
|
|
|
public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null)
|
|
|
{
|
|
|
- if (null === $this->translator) {
|
|
|
- throw new \RuntimeException('Translator is not enabled.');
|
|
|
- }
|
|
|
-
|
|
|
return $this->translator->trans($id, $parameters, $domain, $locale);
|
|
|
}
|
|
|
|
|
@@ -50,10 +46,6 @@ class TranslatorHelper extends Helper
|
|
|
*/
|
|
|
public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null)
|
|
|
{
|
|
|
- if (null === $this->translator) {
|
|
|
- throw new \RuntimeException('Translator is not enabled.');
|
|
|
- }
|
|
|
-
|
|
|
return $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
|
|
|
}
|
|
|
|