Merge pull request #6628 from open-sausages/pulls/4.0/fix-i18n-theme-lang-dirs

Absolute paths for theme lang dirs (fixes #1354)
This commit is contained in:
Daniel Hensby 2017-02-17 08:24:03 +00:00 committed by GitHub
commit a3ff6d56ec

View File

@ -91,7 +91,7 @@ class Sources implements Resettable
}
$paths = [];
// Search sorted modules
// Search sorted modules (receives absolute paths)
foreach ($this->getSortedModules() as $module => $path) {
$langPath = "{$path}/lang/";
if (is_dir($langPath)) {
@ -99,14 +99,14 @@ class Sources implements Resettable
}
}
// Search theme dirs
// Search theme dirs (receives relative paths)
$locator = ThemeResourceLoader::instance();
foreach (SSViewer::get_themes() as $theme) {
if ($locator->getSet($theme)) {
continue;
}
$path = $locator->getPath($theme);
$langPath = "{$path}/lang/";
$langPath = BASE_PATH . "/{$path}/lang/";
if (is_dir($langPath)) {
$paths[] = $langPath;
}