rande/mgI18nPlugin

Error in Documentation on import: not able to use *

Opened this issue · 0 comments

Hi
when you try with the '*' it fails because it is not a file...

i added the following in mgI18nimportTask class:

protected function handleSource($message_source, $application, $source)
{

$culture = null;

$this->logSection('mgI18n', 'Analysing '.$source);


if (strstr($source,'*') && is_dir(chop($source,'*'))){
    //  Means we want all files
    $dir = chop($source,'*');
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
           $this->handleSource($message_source, $application, $dir.'/'.$file);          
        }
        closedir($dh);
        return;
    }
}
if(is_file($source))
{
  $info =  pathinfo($source);

  $name_info = explode('.', $info['basename']);

  if(count($name_info) < 3 || $info['extension'] != 'xml')
  {

    $this->logSection('mgI18n', 'Wrong file name format : path/to/file.LANG.xml');
    return;
  }