Prado\I18N\core\Gettext\TGettext::poFile2moFile PHP Метод

poFile2moFile() статический публичный Метод

That's a simple fake of the 'msgfmt' console command. It reads the contents of a GNU PO file and saves them to a GNU MO file.
static public poFile2moFile ( string $pofile, string $mofile ) : mixed
$pofile string path to GNU PO file
$mofile string path to GNU MO file
Результат mixed Returns true on success or PEAR_Error on failure.
    static function poFile2moFile($pofile, $mofile)
    {
        if (!is_file($pofile)) {
            throw new Exception("File {$pofile} doesn't exist.");
        }
        include_once dirname(__FILE__) . '/PO.php';
        $PO = new TGettext_PO($pofile);
        if (true !== ($e = $PO->load())) {
            return $e;
        }
        $MO = $PO->toMO();
        if (true !== ($e = $MO->save($mofile))) {
            return $e;
        }
        unset($PO, $MO);
        return true;
    }