From 0fa53d5f5d79d2855cacd0656bc38727423b6c3d Mon Sep 17 00:00:00 2001 From: Sommerregen Date: Sun, 4 Oct 2015 17:55:51 +0200 Subject: [PATCH] Load language files according to stream configurations --- system/src/Grav/Common/Config/Config.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/system/src/Grav/Common/Config/Config.php b/system/src/Grav/Common/Config/Config.php index 0cafeb7a0..9e69e994c 100644 --- a/system/src/Grav/Common/Config/Config.php +++ b/system/src/Grav/Common/Config/Config.php @@ -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) {