mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Correctly loading plugins in I18n
This commit is contained in:
parent
0ef0707575
commit
7171887c7a
2 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue