mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX i18n::include_by_locale() assumes a themes directory always exists and causes error if that's not the case. Some projects don't require any themes, like pure applications.
This commit is contained in:
parent
83ad8d48a9
commit
7805e3e6d9
@ -1872,13 +1872,15 @@ class i18n extends Object {
|
|||||||
|
|
||||||
// Load translations from themes
|
// Load translations from themes
|
||||||
$themesBase = $base . '/themes';
|
$themesBase = $base . '/themes';
|
||||||
foreach(scandir($themesBase) as $theme) {
|
if(is_dir($themesBase)) {
|
||||||
if(
|
foreach(scandir($themesBase) as $theme) {
|
||||||
strpos($theme, SSViewer::current_theme()) === 0
|
if(
|
||||||
&& file_exists($file = "$themesBase/$theme/lang/$locale.php")
|
strpos($theme, SSViewer::current_theme()) === 0
|
||||||
) {
|
&& file_exists($file = "$themesBase/$theme/lang/$locale.php")
|
||||||
if ($force_load) include($file);
|
) {
|
||||||
else include_once($file);
|
if ($force_load) include($file);
|
||||||
|
else include_once($file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user