Exemplo n.º 1
0
        function mkPotStr(&$POs, $msg)
        {
            $time = current_time('mysql');
            $potHead = <<<EOF
# This file was generated by EzTran for {$this->plgName}
# Your Name: {$msg["name"]}
# Your Email: {$msg["email"]}
# Your Website: {$msg["blog"]}
# Your URL: {$msg["url"]}
# Your Locale: {$msg["locale"]}
# Your Language: {$msg["ezt-target"]}
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: {$this->plgName}\\n"
"PO-Revision-Date: {$time}\\n"
"Last-Translator: {$msg['name']} <{$msg['email']}>\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset={$msg['charset']}\\n"
"Content-Transfer-Encoding: 8bit\\n"


EOF;
            $pot = array();
            foreach ($POs as $po) {
                if (empty($pot[$po->domain])) {
                    $pot[$po->domain] = $potHead;
                }
                $pot[$po->domain] .= 'msgid "' . PO::decorate($po->id, "\n\r\"") . "\"\n";
                if (empty($msg[$po->num])) {
                    $t = '';
                } else {
                    $t = $msg[$po->num];
                }
                $pot[$po->domain] .= 'msgstr "' . PO::decorate($t, "\n\r") . "\"\n\n";
            }
            return $pot;
        }