1 | <?php |
||
8 | class CachedTranslationFile |
||
9 | { |
||
10 | /** |
||
11 | * Local filesystem. Already contains the path to our translation files |
||
12 | * e.g. storage/app/trans |
||
13 | * |
||
14 | * @var Filesystem |
||
15 | */ |
||
16 | private $filesystem; |
||
17 | |||
18 | public function __construct(Filesystem $filesystem) |
||
22 | |||
23 | /** |
||
24 | * Write all translations to cache |
||
25 | */ |
||
26 | public function write() |
||
35 | |||
36 | /** |
||
37 | * Create new cached translation files based on database entries |
||
38 | * |
||
39 | * @param $locale |
||
40 | * @param array $lines - flat array of key-value pairs e.g. foo.bar => 'translation of foo' |
||
41 | */ |
||
42 | protected function writeLocale($locale, array $lines = []) |
||
54 | |||
55 | public function delete($locale = null) |
||
69 | |||
70 | private function convertToTree(array $lines = []) |
||
80 | } |