mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 00:41:55 +02:00
Load language files according to stream configurations
This commit is contained in:
@@ -366,14 +366,16 @@ class Config extends Data
|
||||
|
||||
// Load languages.
|
||||
$this->languages = new Languages;
|
||||
|
||||
if (isset($languageFiles['user/plugins'])) {
|
||||
foreach ((array) $languageFiles['user/plugins'] as $plugin => $item) {
|
||||
$lang_file = CompiledYamlFile::instance($item['file']);
|
||||
$content = $lang_file->content();
|
||||
$this->languages->mergeRecursive($content);
|
||||
$pluginPaths = str_ireplace(GRAV_ROOT . '/', '', array_reverse($plugins));
|
||||
foreach ($pluginPaths as $path) {
|
||||
if (isset($languageFiles[$path])) {
|
||||
foreach ((array) $languageFiles[$path] as $plugin => $item) {
|
||||
$lang_file = CompiledYamlFile::instance($item['file']);
|
||||
$content = $lang_file->content();
|
||||
$this->languages->mergeRecursive($content);
|
||||
}
|
||||
unset($languageFiles[$path]);
|
||||
}
|
||||
unset($languageFiles['user/plugins']);
|
||||
}
|
||||
|
||||
foreach ($languageFiles as $location) {
|
||||
|
||||
Reference in New Issue
Block a user