Skip to content

Commit

Permalink
Load language files according to stream configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sommerregen committed Oct 6, 2015
1 parent e593381 commit 0fa53d5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions system/src/Grav/Common/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,16 @@ protected function loadCompiledLanguages($languages, $plugins, $filename = null)

// 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) {
Expand Down

0 comments on commit 0fa53d5

Please sign in to comment.