1 | <?php namespace Modules\Translation\Services; |
||
6 | class TranslationsWriter |
||
7 | { |
||
8 | /** |
||
9 | * @var Filesystem |
||
10 | */ |
||
11 | private $finder; |
||
12 | /** |
||
13 | * @var TranslationsService |
||
14 | */ |
||
15 | private $translationsService; |
||
16 | |||
17 | public function __construct(TranslationsService $translationsService, Filesystem $finder) |
||
18 | { |
||
19 | $this->finder = $finder; |
||
20 | $this->translationsService = $translationsService; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Export all translations back to disk |
||
25 | */ |
||
26 | public function export() |
||
42 | |||
43 | /** |
||
44 | * Get the module name from the given key |
||
45 | * @param string $key |
||
46 | * @return string |
||
47 | */ |
||
48 | private function getModuleNameFrom($key) |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | private function getTranslationsDirectory() |
||
60 | |||
61 | /** |
||
62 | * Get the file name from the given key |
||
63 | * @param string $key |
||
64 | * @return string |
||
65 | */ |
||
66 | private function getFileNameFrom($key) |
||
72 | |||
73 | /** |
||
74 | * Make a usable array |
||
75 | * @param TranslationGroup $translations |
||
76 | * @return array |
||
77 | */ |
||
78 | private function makeTree(TranslationGroup $translations) |
||
94 | } |
||
95 |