function _pocheck($po) { global $DBInfo; include_once 'lib/Gettext/PO.php'; $myPO = new TGettext_PO(); if (true !== ($e = $myPO->load($po, 0))) { print "Fail to load po file.\n"; return $e; } $myMO = $myPO->toMO(); $vartmp_dir = $DBInfo->vartmp_dir; $tmp = tempnam($vartmp_dir, "GETTEXT"); #$tmp=$vartmp_dir."/GETTEXT.mo"; if (true !== ($e = $myMO->save($tmp))) { print "Fail to compile mo file.\n"; return $e; } unset($myPO, $myMO); chmod($tmp, 0644); //unlink($tmp); return true; }
/** * toPO * * @access protected * @return object File_Gettext_PO */ function toPO() { include_once dirname(__FILE__) . '/PO.php'; $PO = new TGettext_PO(); $PO->fromArray($this->toArray()); return $PO; }
/** * toPO * * @access protected * @return object File_Gettext_PO */ function toPO() { include_once __DIR__ . '/PO.php'; $PO = new TGettext_PO(); $PO->fromArray($this->toArray()); return $PO; }