mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating path handling inside i18n. Removes the extra DS that was appended to some paths. Fixes #126
This commit is contained in:
parent
dc220bbb21
commit
5f49a0f25c
2 changed files with 8 additions and 5 deletions
|
@ -263,7 +263,7 @@ class I18n extends Object {
|
|||
$plugin = Inflector::underscore($plugin);
|
||||
if ($plugin === $domain) {
|
||||
foreach ($pluginPaths as $pluginPath) {
|
||||
$searchPaths[] = $pluginPath . DS . $plugin . DS . 'locale';
|
||||
$searchPaths[] = $pluginPath . $plugin . DS . 'locale' . DS;
|
||||
}
|
||||
$searchPaths = array_reverse($searchPaths);
|
||||
break;
|
||||
|
@ -271,12 +271,15 @@ class I18n extends Object {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($searchPaths as $directory) {
|
||||
|
||||
foreach ($this->l10n->languagePath as $lang) {
|
||||
$file = $directory . DS . $lang . DS . $this->category . DS . $domain;
|
||||
$file = $directory . $lang . DS . $this->category . DS . $domain;
|
||||
|
||||
if ($core) {
|
||||
$app = $directory . DS . $lang . DS . $this->category . DS . 'core';
|
||||
$app = $directory . $lang . DS . $this->category . DS . 'core';
|
||||
|
||||
if (file_exists($fn = "$app.mo")) {
|
||||
$this->__loadMo($fn, $domain);
|
||||
$this->__noLocale = false;
|
||||
|
|
|
@ -43,10 +43,10 @@ class I18nTest extends CakeTestCase {
|
|||
Configure::write('__objects', array());
|
||||
|
||||
$this->_localePaths = Configure::read('localePaths');
|
||||
Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'));
|
||||
Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS));
|
||||
|
||||
$this->_pluginPaths = Configure::read('pluginPaths');
|
||||
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'));
|
||||
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS));
|
||||
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue