本文整理汇总了PHP中PO::decorate方法的典型用法代码示例。如果您正苦于以下问题:PHP PO::decorate方法的具体用法?PHP PO::decorate怎么用?PHP PO::decorate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PO
的用法示例。
在下文中一共展示了PO::decorate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mkPotStr
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;
}