1 | <?php |
||
19 | trait TranslateMethods |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var TranslatorInterface |
||
24 | */ |
||
25 | protected $translator; |
||
26 | |||
27 | /** |
||
28 | * Translate the provided message |
||
29 | * |
||
30 | 2 | * @param string $message |
|
31 | * |
||
32 | 2 | * @return string The translated message |
|
33 | */ |
||
34 | public function translate($message) |
||
39 | |||
40 | /** |
||
41 | * Translates the provided message to singular or plural according to the number |
||
42 | * |
||
43 | * @param string $singular |
||
44 | * @param string $plural |
||
45 | * @param integer $number |
||
46 | 2 | * |
|
47 | * @return string |
||
48 | */ |
||
49 | 2 | public function translatePlural($singular, $plural, $number) |
|
54 | |||
55 | /** |
||
56 | * Checks if translate property is set |
||
57 | */ |
||
58 | private function checkTranslator() |
||
68 | } |