1 | <?php |
||
9 | class LaravelTranslationsReader |
||
10 | { |
||
11 | /** |
||
12 | * @var \Illuminate\Support\Collection |
||
13 | */ |
||
14 | private $translations; |
||
15 | |||
16 | /** |
||
17 | * Local filesystem. Already contains the path to our translation files |
||
18 | * e.g. storage/app/trans |
||
19 | * |
||
20 | * @var Filesystem |
||
21 | */ |
||
22 | private $filesystem; |
||
23 | private $path; |
||
24 | |||
25 | 9 | public function __construct(Filesystem $filesystem) |
|
31 | |||
32 | /** |
||
33 | * Read the lang files for a specific locale |
||
34 | * |
||
35 | * @param $locale |
||
36 | * @param array $excluded filenames that should be excluded from the read |
||
37 | * @return \Illuminate\Support\Collection |
||
38 | */ |
||
39 | 9 | public function read($locale, array $excluded = []) |
|
62 | |||
63 | /** |
||
64 | * @return \Illuminate\Support\Collection |
||
65 | */ |
||
66 | 1 | public function get() |
|
70 | |||
71 | /** |
||
72 | * Flatten per file a multi-dimensional associative array with dots. |
||
73 | |||
74 | * @return \Illuminate\Support\Collection |
||
75 | */ |
||
76 | 1 | public function flattenPerFile() |
|
82 | |||
83 | /** |
||
84 | * Flatten all files which also flattens the filenames (groups) with dots. |
||
85 | * Note: This will remove any empty language files |
||
86 | * |
||
87 | * @return \Illuminate\Support\Collection |
||
88 | */ |
||
89 | 6 | public function flatten() |
|
95 | |||
96 | /** |
||
97 | * @param $values |
||
98 | * @param $groupkey |
||
99 | * @return array |
||
100 | */ |
||
101 | 5 | private function prependGroupkey($values, $groupkey) |
|
117 | |||
118 | 9 | private function getSquantoLangPath() |
|
123 | |||
124 | 9 | public function validateTranslations() |
|
133 | } |
||
134 |