Skip to content
Permalink
Browse files

Use locale path set in config

  • Loading branch information...
Iandenh committed Oct 16, 2018
1 parent 1c8dd01 commit bac14598cffc35f4afb5da7ddd843a24a7b41b1d
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Shell/I18nShell.php
@@ -15,6 +15,7 @@
namespace Cake\Shell;
use Cake\Console\Shell;
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Utility\Inflector;
use DirectoryIterator;
@@ -94,13 +95,13 @@ public function init($language = null)
$this->abort('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
}
$this->_paths = [APP];
$this->_paths = App::path('Locale');
if ($this->param('plugin')) {
$plugin = Inflector::camelize($this->param('plugin'));
$this->_paths = [Plugin::classPath($plugin)];
$this->_paths = App::path('Locale', $plugin);
}
$response = $this->in('What folder?', null, rtrim($this->_paths[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'Locale');
$response = $this->in('What folder?', null, rtrim($this->_paths[0], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR);
$sourceFolder = rtrim($response, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$targetFolder = $sourceFolder . $language . DIRECTORY_SEPARATOR;
if (!is_dir($targetFolder)) {

0 comments on commit bac1459

Please sign in to comment.
You can’t perform that action at this time.