• dedecms如何修改共0页/0条记录为英文版?


    近日,在测试一个网站功能的时候,发现在搜索结果的下面为中文的“共0页/0条记录”,但客户的网站为英文版,所以我们需要将搜索的结果信息也要显示为英文,好了,我们开始动手修改dedecms的文件,以达到我们需要的效果吧!

    dedecms如何修改共0页/0条记录为英文版?

    “共0页/0条记录”我们需要修改include/datalistcp.class.php文件,但是请注意修改了这个文件之后其它很多地方的分页内容都将是显示英文的。

    找到文件大概在第30行:

        $lang_pre_page = '上页';
        $lang_next_page = '下页';
        $lang_index_page = '首页';
        $lang_end_page = '末页';
        $lang_record_number = '条记录';
        $lang_page = '页';
        $lang_total = '共';

    修改为:

        $lang_pre_page = 'Previous';
        $lang_next_page = 'Next';
        $lang_index_page = 'Home';
        $lang_end_page = 'End';
        $lang_record_number = 'Records';
        $lang_page = 'Page';
        $lang_total = 'Total';

    保存之后我们测试搜索结果!成功的达到了我们需要的效果。

    修改include/arc.searchview.class.php文件

    找到文件大概在第820行:

            if($totalpage<=1 && $this->TotalResult>0)
            {
                return "共1页/".$this->TotalResult."条记录";
            }
            if($this->TotalResult == 0)
            {
                return "共0页/".$this->TotalResult."条记录";
            }

    修改为:

            if($totalpage<=1 && $this->TotalResult>0)
            {
                return "Total 1 Page/".$this->TotalResult."Records";
            }
            if($this->TotalResult == 0)
            {
                return "Total 0 Page/".$this->TotalResult."Records";
            }

    找到文件大概在第837行:

    $infos = "<td>共找到<b>".$this->TotalResult."</b>条记录/最大显示<b>{$totalpage}</b>页 </td> ";

    修改为:

    $infos = "<td>Total<b>".$this->TotalResult."</b>Records/Max. Display<b>{$totalpage}</b>Page </td> ";

    找到文件大概在第852行:

    if($this->PageNo != 1)
    {
    $prepage.="<td width='50'><a href='".$purl."PageNo=$prepagenum'>上一页</a></td> ";
    $indexpage="<td width='30'><a href='".$purl."PageNo=1'>首页</a></td> ";
    }
    else
    {
    $indexpage="<td width='30'>首页</td> ";
    }
    if($this->PageNo!=$totalpage && $totalpage>1)
    {
    $nextpage.="<td width='50'><a href='".$purl."PageNo=$nextpagenum'>下一页</a></td> ";
    $endpage="<td width='30'><a href='".$purl."PageNo=$totalpage'>末页</a></td> ";
    }
    else
    {
    $endpage="<td width='30'>末页</td> ";
    }

    修改为:

    if($this->PageNo != 1)
    {
    $prepage.="<td width='50'><a href='".$purl."PageNo=$prepagenum'>Previous</a></td> ";
    $indexpage="<td width='30'><a href='".$purl."PageNo=1'>Home</a></td> ";
    }
    else
    {
    $indexpage="<td width='30'>Home</td> ";
    }
    if($this->PageNo!=$totalpage && $totalpage>1)
    {
    $nextpage.="<td width='50'><a href='".$purl."PageNo=$nextpagenum'>Next</a></td> ";
    $endpage="<td width='30'><a href='".$purl."PageNo=$totalpage'>End</a></td> ";
    }
    else
    {
    $endpage="<td width='30'>End</td> ";
    }

     修改include/arc.archives.class.php文件
     

    找到文件大概在第873行:
     

    $PageList = "<li><a>共".$totalPage."页: </a></li>";
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.="<li><a href='#'>上一页</a></li>";

    ......

    修改为:

    $PageList = "<li><a>Total".$totalPage."Page: </a></li>";
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.="<li><a href='#'>Previous</a></li>";
    ......

    找到文件大概在第966行:

    $PageList = "<li><a>共".$totalPage."页: </a></li>";
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.="<li><a href='#'>上一页</a></li>";
    }

    修改为:

    $PageList = "<li><a>Total".$totalPage."Page: </a></li>";
    $nPage = $nowPage-1;
    $lPage = $nowPage+1;
    if($nowPage==1)
    {
    $PageList.="<li><a href='#'>Previous</a></li>";
    }

    注意文件里面的中文改成相对应的英文即可。

    修改arc.listview.class.php

  • 相关阅读:
    写excel文件-xlsxwriter包的使用
    python代码规范
    mac系统的插件
    bash字符串处理
    ssh到ubuntu没颜色
    linux mysql 端口号修改
    Centos7 编译安装 PHP7.1,以及msgpack扩展
    Xmanager4注册码
    Python 的 pyinotify 模块 监控文件夹和文件的变动
    Python的50个模块,满足你各种需要
  • 原文地址:https://www.cnblogs.com/chixiaobai/p/4533434.html
Copyright © 2020-2023  润新知