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:
Sean Harvey 2011-09-28 15:27:51 +13:00
parent 83ad8d48a9
commit 7805e3e6d9

View File

@ -1872,13 +1872,15 @@ class i18n extends Object {
// Load translations from themes
$themesBase = $base . '/themes';
foreach(scandir($themesBase) as $theme) {
if(
strpos($theme, SSViewer::current_theme()) === 0
&& file_exists($file = "$themesBase/$theme/lang/$locale.php")
) {
if ($force_load) include($file);
else include_once($file);
if(is_dir($themesBase)) {
foreach(scandir($themesBase) as $theme) {
if(
strpos($theme, SSViewer::current_theme()) === 0
&& file_exists($file = "$themesBase/$theme/lang/$locale.php")
) {
if ($force_load) include($file);
else include_once($file);
}
}
}