汉化一下下松鼠邮件系统SquirrelMail

架设了一个邮件服务器,使用SquirrelMail做为web平台,发现它的Drafts、Sent、Trash三个邮箱名还是英文的,太不专业了吧。上网查帮助,它在sourceforge的官方留言板上对这个问题回答如下:

3> how do I translate the "trash/sent/drafts" into
> Chinese (simplified), since there seems no entries for
> them in .po file.

This must be changed at configuration level. Go to conf.pl and change
the default folders names to whatever you like. This cannot be changed
with po because it depends on the IMAP server. The only folder that can
be renamed is the INBOX wich is a "system" name.

在另外一个论坛上,有个老外直接了当地回答说,这个问题是无法解决的。哼哼,我就不信改不过来~看我的:

因为左边的邮箱目录在left_main.php中,我打开它,增加一个function

// --Add by Anjo, 2006.9.3
function rename_subbox($mailboxstr, $oldname, $newname) {
    $len0=strlen($mailboxstr);
    $len1=strlen($oldname);
    if (strpos($mailboxstr, $oldname, $len0-$len1)==$len0-$len1) {
        return substr($mailboxstr, 0, $len0-$len1).$newname;
    }
    else
        return $mailboxstr;
}
// --end of Anjo's function

然后找到这一段

    if ($special_color) {
        $line .= "<font color=/"$color[11]/">";
    }
    if ( $mailbox == 'INBOX' ) {
        $line .= _("INBOX");
    } else {
        $line .= str_replace(array(' ','<','>'),array('&nbsp;','&lt;','&gt;'),$mailbox);
    }

在它后面加上:

    //-- By Anjo, for translate "Drafts", "Sent" and "Trush"
    $line = rename_subbox($line, "Drafts", "草稿箱");
    $line = rename_subbox($line, "Sent",   "发件箱");
    $line = rename_subbox($line, "Trash",  "回收站");

 引用自 http://www.ilikeblog.comtb.asp?id=930
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值