* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBNLS_Extractor' , 'WBNLS_Extractor_Table'); /** * Native Lanauge Support: Extractor From All Tables * * Extract translatable messages from all tables configured with translatable columns * * @version 1.0.0 * @package WB * @subpackage nls */ class WBNLS_Extractor_Table_All extends WBNLS_Extractor_Table { /** * Default configuration * * @var array */ protected $config = array( 'ignore' => array() ); /** * Actually extract messages * * Go through all tables and extract translatable columns */ protected function extract() { if (!is_array($this->config['ignore'])) { $this->config['ignore'] = array(); } $cnt = 0; $tables = $this->ta->getTables(); foreach ($tables as $table) { $info = $this->ta->getTableInfo($table); if (!isset($info['translatable']) || empty($info['translatable'])) { continue; } if (in_array($table, $this->config['ignore'])) { continue; } $this->table = $table; $this->fields = $info['translatable']; $cnt += parent::extract(); } return $cnt; } }