* @package Wombat * @subpackage base */ /** * initialize patI18n_Importer * * @version 0.1.0 * @package Wombat * @subpackage base */ class WBClass_Creator_patI18n_Importer extends WBClass_Creator { /** * call counter * @var patI18n_Importer */ private static $imp; /** * instanciate new objects * * @param array $params options to create object * @return $obj */ public function instantiate( $parameter = array() ) { if (self::$imp) { return self::$imp; } $config = WBClass::create('WBConfig'); $config->load('locale'); $moduleConf = array( 'domain' => '', 'domains' => array('wombat', 'patForms'), ); $trans = $config->get('translators', array()); if (empty($trans) || !isset($trans['modules'])) { $trans['modules'] = array(); } foreach ($trans['modules'] as $mod) { if ('Wombat' != $mod['module']) { continue; } $moduleConf['domain'] = $mod['defaultdomain']; $moduleConf['domains'] = $mod['domains']; } self::$imp = patI18n::createImporter('Wombat', $moduleConf); return self::$imp; } }