1 | <?php |
||
8 | class LaravelTranslationsReader |
||
9 | { |
||
10 | /** |
||
11 | * @var \Illuminate\Support\Collection |
||
12 | */ |
||
13 | private $translations; |
||
14 | |||
15 | /** |
||
16 | * Local filesystem. Already contains the path to our translation files |
||
17 | * e.g. storage/app/trans |
||
18 | * |
||
19 | * @var Filesystem |
||
20 | */ |
||
21 | private $filesystem; |
||
22 | private $path; |
||
23 | |||
24 | 27 | public function __construct(Filesystem $filesystem) |
|
30 | |||
31 | /** |
||
32 | * Read the lang files for a specific locale |
||
33 | * |
||
34 | * @param $locale |
||
35 | * @param array $excluded filenames that should be excluded from the read |
||
36 | * @return \Illuminate\Support\Collection |
||
37 | */ |
||
38 | 27 | public function read($locale, array $excluded = []) |
|
60 | |||
61 | 2 | /** |
|
62 | * @return \Illuminate\Support\Collection |
||
63 | */ |
||
64 | 1 | public function get() |
|
68 | |||
69 | 2 | /** |
|
70 | * Flatten per file a multi-dimensional associative array with dots. |
||
71 | |||
72 | 2 | * @return \Illuminate\Support\Collection |
|
73 | 2 | */ |
|
74 | 1 | public function flattenPerFile() |
|
80 | |||
81 | /** |
||
82 | * Flatten all files which also flattens the filenames (groups) with dots. |
||
83 | * Note: This will remove any empty language files |
||
84 | 14 | * |
|
85 | 12 | * @return \Illuminate\Support\Collection |
|
86 | 14 | */ |
|
87 | public function flatten() |
||
93 | |||
94 | 12 | /** |
|
95 | * @param $values |
||
96 | 12 | * @param $groupkey |
|
97 | 12 | * @return array |
|
98 | */ |
||
99 | 18 | private function prependGroupkey($values, $groupkey) |
|
115 | |||
116 | 9 | private function getSquantoLangPath() |
|
121 | } |
||
122 |