-
Notifications
You must be signed in to change notification settings - Fork 1
/
TranslatorHelper.php
45 lines (40 loc) · 925 Bytes
/
TranslatorHelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Matt9mg\Concrete5\Symfony\Form;
use Symfony\Component\Templating\Helper\Helper;
/**
* Class TranslatorHelper
* @package Matt9mg\Concrete5\Symfony\Form
*/
class TranslatorHelper extends Helper
{
/**
* @param $id
* @param array $parameters
* @param string $domain
* @param null $locale
* @return string
*/
public function trans($id, array $parameters = [], $domain = 'messages', $locale = null): string
{
return t($id);
}
/**
* @param $id
* @param $number
* @param array $parameters
* @param string $domain
* @param null $locale
* @return string
*/
public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null): string
{
return t($id);
}
/**
* {@inheritdoc}
*/
public function getName()
{
return 'translator';
}
}