mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
commit
a3ff6d56ec
@ -91,7 +91,7 @@ class Sources implements Resettable
|
|||||||
}
|
}
|
||||||
$paths = [];
|
$paths = [];
|
||||||
|
|
||||||
// Search sorted modules
|
// Search sorted modules (receives absolute paths)
|
||||||
foreach ($this->getSortedModules() as $module => $path) {
|
foreach ($this->getSortedModules() as $module => $path) {
|
||||||
$langPath = "{$path}/lang/";
|
$langPath = "{$path}/lang/";
|
||||||
if (is_dir($langPath)) {
|
if (is_dir($langPath)) {
|
||||||
@ -99,14 +99,14 @@ class Sources implements Resettable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search theme dirs
|
// Search theme dirs (receives relative paths)
|
||||||
$locator = ThemeResourceLoader::instance();
|
$locator = ThemeResourceLoader::instance();
|
||||||
foreach (SSViewer::get_themes() as $theme) {
|
foreach (SSViewer::get_themes() as $theme) {
|
||||||
if ($locator->getSet($theme)) {
|
if ($locator->getSet($theme)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$path = $locator->getPath($theme);
|
$path = $locator->getPath($theme);
|
||||||
$langPath = "{$path}/lang/";
|
$langPath = BASE_PATH . "/{$path}/lang/";
|
||||||
if (is_dir($langPath)) {
|
if (is_dir($langPath)) {
|
||||||
$paths[] = $langPath;
|
$paths[] = $langPath;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user