Skip to content

Commit d4f95b1

Browse files
committed
Allow language files to be found in any namespace we know about.
1 parent 30f2d97 commit d4f95b1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

system/Language/Language.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ protected function load(string $file, string $locale, bool $return = false)
135135
$this->language[$file] = [];
136136
}
137137

138-
$lang = [];
139-
140138
$path = "Language/{$locale}/{$file}.php";
141139

142140
$lang = $this->requireFile($path);
@@ -167,14 +165,16 @@ protected function load(string $file, string $locale, bool $return = false)
167165
*/
168166
protected function requireFile(string $path): array
169167
{
170-
foreach ([APPPATH, BASEPATH] as $folder)
168+
$files = service('locator')->search($path);
169+
170+
foreach ($files as $file)
171171
{
172-
if (! is_file($folder.$path))
172+
if (! is_file($file))
173173
{
174174
continue;
175175
}
176176

177-
return require_once $folder.$path;
177+
return require_once $file;
178178
}
179179

180180
return [];

0 commit comments

Comments
 (0)