1 | <?php |
||
24 | 1 | class FileTranslator implements \Nette\Localization\ITranslator |
|
25 | { |
||
26 | 1 | use Nette\SmartObject; |
|
27 | |||
28 | /** @var array */ |
||
29 | protected $translations = []; |
||
30 | |||
31 | /** |
||
32 | * @param string $lang |
||
33 | * @param array $translations |
||
34 | */ |
||
35 | public function __construct($lang = 'en', array $translations = []) |
||
40 | |||
41 | /** |
||
42 | * Sets language of translation. |
||
43 | * @param string $lang |
||
44 | */ |
||
45 | public function setLang($lang) |
||
49 | |||
50 | /** |
||
51 | * @param string $lang |
||
52 | * @throws Exception |
||
53 | * @return array |
||
54 | */ |
||
55 | protected function getTranslationsFromFile($lang) |
||
64 | |||
65 | /************************* interface \Nette\Localization\ITranslator **************************/ |
||
66 | |||
67 | /** |
||
68 | * @param string $message |
||
69 | * @param int $count plural |
||
70 | * @return string |
||
71 | */ |
||
72 | public function translate($message, $count = NULL) |
||
78 | } |
||
79 |