1 | <?php |
||
15 | class Translator extends SymfonyTranslator |
||
16 | { |
||
17 | /** |
||
18 | * @var LocalesManager |
||
19 | */ |
||
20 | private $manager; |
||
21 | |||
22 | /** |
||
23 | * @param array $data Constructor data. |
||
24 | * @return |
||
25 | */ |
||
26 | public function __construct(array $data) |
||
50 | |||
51 | /** |
||
52 | * Get a translation object from a (mixed) value. |
||
53 | * |
||
54 | * @param mixed $val The string or translation-object to retrieve. |
||
55 | * @return Translation|null |
||
56 | */ |
||
57 | public function translation($val) |
||
70 | |||
71 | /** |
||
72 | * Get a translated string from a (mixed) value. |
||
73 | * |
||
74 | * @param mixed $val The string or translation-object to retrieve. |
||
75 | * @return string |
||
76 | */ |
||
77 | public function translate($val) |
||
86 | |||
87 | /** |
||
88 | * @return string[] |
||
89 | */ |
||
90 | public function locales() |
||
94 | |||
95 | /** |
||
96 | * @return string[] |
||
97 | */ |
||
98 | public function availableLocales() |
||
102 | |||
103 | /** |
||
104 | * Ensure that the `setLocale()` method also changes the locales manager's language. |
||
105 | * |
||
106 | * @see SymfonyTranslator::setLocale() |
||
107 | * @param string $locale The locale ident (language) to set. |
||
108 | * @return void |
||
109 | */ |
||
110 | public function setLocale($locale) |
||
115 | |||
116 | /** |
||
117 | * @param LocalesManager $manager The Locales manager. |
||
118 | * @return void |
||
119 | */ |
||
120 | private function setManager(LocalesManager $manager) |
||
124 | |||
125 | /** |
||
126 | * @param mixed $val The value to be checked. |
||
127 | * @return boolean |
||
128 | */ |
||
129 | private function isValidTranslation($val) |
||
160 | } |
||
161 |