Skip to content

Commit

Permalink
Updating path handling inside i18n. Removes the extra DS that was app…
Browse files Browse the repository at this point in the history
…ended to some paths. Fixes #126
  • Loading branch information
markstory committed Sep 30, 2009
1 parent dc220bb commit 5f49a0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cake/libs/i18n.php
Expand Up @@ -263,20 +263,23 @@ function __bindTextDomain($domain) {
$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;
}
}
}


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;
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/libs/i18n.test.php
Expand Up @@ -43,10 +43,10 @@ function setUp() {
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));

}
/**
Expand Down

0 comments on commit 5f49a0f

Please sign in to comment.