Permalink
Browse files

Updating path handling inside i18n. Removes the extra DS that was app…

…ended to some paths. Fixes #126
  • Loading branch information...
markstory committed Sep 30, 2009
1 parent dc220bb commit 5f49a0f25c67df77bea7728a67e3a76679c76e15
Showing with 8 additions and 5 deletions.
  1. +6 −3 cake/libs/i18n.php
  2. +2 −2 cake/tests/cases/libs/i18n.test.php
View
@@ -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;
@@ -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));
}
/**

0 comments on commit 5f49a0f

Please sign in to comment.