} else { $lang=new LPC_Language(); $lang->setAttr('locale_POSIX',$langData['locale_POSIX']); } $lang->setAttr('name',$langData['name']); $lang->save(); $langMapping[$langData['id']]=$lang->id; } // 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',
$p->show(); } if (isset($_POST['delete'])) { $ref->delete(); header("Location: message_select.php"); exit; } $target_lang=new LPC_Language($_SESSION['LPC_target_lang']); $reference_lang=new LPC_Language($_SESSION['LPC_reference_lang']); if (isset($_POST['submit'])) { LPC_HTML_form::enforceSK(); $msg->setAttr('translation',$_POST['translation']); $msg->save(); $ref->setAttrs(array( 'comment'=>$_POST['comment'], 'system'=>isset($_POST['system']), )); $ref->save(); } // The links on the top of the page $links=array( "[<a href='lang_select.php?m=".rawurlencode($msgKey)."'>Translate this message to another language</a>]", "[<a href='message_select.php'>Message list</a>]" ); $sql=" SELECT ref.message_key FROM LPC_i18n_reference ref LEFT JOIN LPC_i18n_message msg ON msg.message_key=ref.message_key AND msg.language=".$_SESSION['LPC_target_lang']." WHERE msg.id IS NULL