static function checkReference($messageKey) { if (in_array($messageKey,self::$known_references)) return; self::$known_references[]=$messageKey; $ref=new LPC_I18n_reference($messageKey); if ($ref->probe()) return; $ref->insertWithId($messageKey); }
// Messages foreach($inData['messages'] as $msgKey=>$msgData) { $ref=new LPC_I18n_reference($msgKey); if ($ref->probe()) { $ref->load(); $ref->setAttrs(array( 'comment'=>$msgData['comment'], 'system'=>$msgData['system'], )); $ref->save(); } else { $ref->setAttrs(array( 'comment'=>$msgData['comment'], 'system'=>$msgData['system'], )); $ref->insertWithId(); } foreach($msgData['translations'] as $trnData) { $msg=new LPC_I18n_message(); $msgs=$msg->search( array( 'language', 'message_key', ), array( $langMapping[$trnData['language']], $ref->id ) ); if ($msgs) {