Browse Source

Use locale path set in config

Ian den Hartog 7 years ago
parent
commit
bac14598cf
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/Shell/I18nShell.php

+ 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 @@ class I18nShell extends Shell
             $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)) {