| 2 |
/** |
/** |
| 3 |
* @package Mambo |
* @package Mambo |
| 4 |
* @subpackage Languages |
* @subpackage Languages |
|
* @copyright Refer to copyright.php |
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
|
| 5 |
* @author Mambo Foundation Inc see README.php |
* @author Mambo Foundation Inc see README.php |
| 6 |
|
* @copyright (C) 2000 - 2009 Mambo Foundation Inc. |
| 7 |
|
* See COPYRIGHT.php for copyright notices and details. |
| 8 |
|
* @license GNU/GPL Version 2, see LICENSE.php |
| 9 |
|
* |
| 10 |
|
* Redistributions of files must retain the above copyright notice. |
| 11 |
|
* |
| 12 |
|
* Mambo is free software; you can redistribute it and/or |
| 13 |
|
* modify it under the terms of the GNU General Public License |
| 14 |
|
* as published by the Free Software Foundation; version 2 of the License. |
| 15 |
*/ |
*/ |
| 16 |
|
|
| 17 |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
| 18 |
class extractAction extends Action |
class extractAction extends Action |
| 19 |
{ |
{ |
| 83 |
|
|
| 84 |
$this->scan_xml($domain, $textdomain, $scandirs, $language); |
$this->scan_xml($domain, $textdomain, $scandirs, $language); |
| 85 |
|
|
| 86 |
$gettext_admin = new PHPGettextAdmin(); |
$gettext_admin = new PHPGettextAdmin(true); |
| 87 |
|
|
| 88 |
$cwd = getcwd(); |
$cwd = getcwd(); |
| 89 |
chdir($path); |
chdir($path); |
| 90 |
|
|
| 133 |
case 'name': |
case 'name': |
| 134 |
case 'description': |
case 'description': |
| 135 |
case 'option': |
case 'option': |
| 136 |
if (isset($value['value']) && strlen($value['value']) >=1) $strings[$file][] = $value['value']; |
case 'menu': |
| 137 |
|
if (isset($value['value']) && strlen($value['value']) >=1) $strings[$file][] = addcslashes($value['value'],'"'); |
| 138 |
break; |
break; |
| 139 |
case 'param': |
case 'param': |
| 140 |
if (isset($value['attributes']) && $value['attributes']['type'] != 'spacer') { |
if (isset($value['attributes']) && $value['attributes']['type'] != 'spacer') { |
| 141 |
if (isset($value['attributes']['label'])) $strings[$file][] = $value['attributes']['label']; |
if (isset($value['attributes']['label'])) $strings[$file][] = addcslashes($value['attributes']['label'],'"'); |
| 142 |
if (isset($value['attributes']['description'])) $strings[$file][] = $value['attributes']['description']; |
if (isset($value['attributes']['description'])) $strings[$file][] = addcslashes($value['attributes']['description'],'"'); |
| 143 |
} |
} |
| 144 |
break; |
break; |
| 145 |
} |
} |
| 151 |
foreach ($str as $msg) |
foreach ($str as $msg) |
| 152 |
$messages[trim($msg)][] = '#: '.$file; |
$messages[trim($msg)][] = '#: '.$file; |
| 153 |
} |
} |
| 154 |
|
if (is_array($messages)){ |
| 155 |
foreach ($messages as $msgid => $comments) { |
foreach ($messages as $msgid => $comments) { |
| 156 |
if (!empty($msgid)) |
if (!empty($msgid)) |
| 157 |
$catalog->addentry($msgid, null, null, $comments);#($msgid, $msgid_plural=null, $msgstr=null, $comments=array()) |
$catalog->addentry($msgid, null, null, $comments);#($msgid, $msgid_plural=null, $msgstr=null, $comments=array()) |
| 158 |
} |
} |
| 159 |
|
} |
| 160 |
$catalog->save(); |
$catalog->save(); |
| 161 |
} |
} |
| 162 |
} |
} |