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,6 +1872,7 @@ class i18n extends Object {
// Load translations from themes // Load translations from themes
$themesBase = $base . '/themes'; $themesBase = $base . '/themes';
if(is_dir($themesBase)) {
foreach(scandir($themesBase) as $theme) { foreach(scandir($themesBase) as $theme) {
if( if(
strpos($theme, SSViewer::current_theme()) === 0 strpos($theme, SSViewer::current_theme()) === 0
@ -1881,6 +1882,7 @@ class i18n extends Object {
else include_once($file); else include_once($file);
} }
} }
}
// Finally, load any translations from registered plugins // Finally, load any translations from registered plugins
if ($load_plugins) self::plugins_load($locale); if ($load_plugins) self::plugins_load($locale);