Correctly loading plugins in I18n

This commit is contained in:
Jose Lorenzo Rodriguez 2011-05-09 00:36:52 -04:30
parent 0ef0707575
commit 7171887c7a
2 changed files with 6 additions and 6 deletions

View file

@ -263,13 +263,13 @@ class I18n {
$core = true;
$merge = array();
$searchPaths = App::path('locales');
$plugins = App::objects('plugin');
$plugins = CakePlugin::loaded();
if (!empty($plugins)) {
foreach ($plugins as $plugin) {
$plugin = Inflector::underscore($plugin);
if ($plugin === $domain) {
$searchPaths[] = App::pluginPath($plugin) . DS . 'locale' . DS;
$pluginDomain = Inflector::underscore($plugin);
if ($pluginDomain === $domain) {
$searchPaths[] = CakePlugin::path($plugin) . DS . 'locale' . DS;
$searchPaths = array_reverse($searchPaths);
break;
}

View file

@ -37,7 +37,7 @@ class I18nTest extends CakeTestCase {
'locales' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
), true);
App::objects('plugin', null, false);
CakePlugin::loadAll();
}
/**
@ -49,7 +49,7 @@ class I18nTest extends CakeTestCase {
function tearDown() {
Cache::delete('object_map', '_cake_core_');
App::build();
App::objects('plugin', null, false);
CakePlugin::unload();
}