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 = []) |
|
59 | 3 | ||
60 | /** |
||
61 | 3 | * @return \Illuminate\Support\Collection |
|
62 | */ |
||
63 | public function get() |
||
67 | |||
68 | /** |
||
69 | 3 | * Flatten per file a multi-dimensional associative array with dots. |
|
70 | |||
71 | * @return \Illuminate\Support\Collection |
||
72 | 3 | */ |
|
73 | 3 | public function flattenPerFile() |
|
79 | |||
80 | /** |
||
81 | * Flatten all files which also flattens the filenames (groups) with dots. |
||
82 | * Note: This will remove any empty language files |
||
83 | * |
||
84 | 21 | * @return \Illuminate\Support\Collection |
|
85 | 18 | */ |
|
86 | 21 | public function flatten() |
|
92 | |||
93 | /** |
||
94 | 18 | * @param $values |
|
95 | * @param $groupkey |
||
96 | 18 | * @return array |
|
97 | 18 | */ |
|
98 | private function prependGroupkey($values, $groupkey) |
||
114 | |||
115 | private function getSquantoLangPath() |
||
120 | } |
||
121 |