Browse Source

recognize gb2312/gbk/gb18030 as gb2312. gb2312 lang file for coverager

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@182 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 15 years ago
parent
commit
ce81573230
  1. 16
      admin/common.php
  2. 25
      coverager/common-zh-simplified-gb2312.lang.php
  3. 16
      coverager/common.php

16
admin/common.php

@ -2,18 +2,28 @@
function get_language_file_ex($name, $l, $s)
{
static $map = array(
static $lmap = array(
'zh' => 'zh-simplified',
'zh-hk' => 'zh-traditional',
'zh-tw' => 'zh-traditional',
);
static $smap = array(
'gbk' => 'gb2312',
'gb18030' => 'gb2312',
);
if (isset($map[$l])) {
$l = $map[$l];
if (isset($lmap[$l])) {
$l = $lmap[$l];
}
if (file_exists($file = "$name-$l-$s.lang.php")) {
return $file;
}
if (isset($smap[$s])) {
$s = $smap[$s];
if (file_exists($file = "$name-$l-$s.lang.php")) {
return $file;
}
}
if (file_exists($file = "$name-$l.lang.php")) {
return $file;
}

25
coverager/common-zh-simplified-gb2312.lang.php

@ -0,0 +1,25 @@
<?php
$strings = array(
'root'
=> '开始',
'Directory'
=> '目录',
'File'
=> '文件',
'Percent'
=> '覆盖率',
'Hits'
=> '命中',
'Lines'
=> '行数',
'TODO'
=> '闲置文件',
'XCache PHP Code Coverage Viewer'
=> 'XCache PHP 代码覆盖查看器',
'module'
=> '模块',
''
=> '',
);

16
coverager/common.php

@ -2,18 +2,28 @@
function get_language_file_ex($name, $l, $s)
{
static $map = array(
static $lmap = array(
'zh' => 'zh-simplified',
'zh-hk' => 'zh-traditional',
'zh-tw' => 'zh-traditional',
);
static $smap = array(
'gbk' => 'gb2312',
'gb18030' => 'gb2312',
);
if (isset($map[$l])) {
$l = $map[$l];
if (isset($lmap[$l])) {
$l = $lmap[$l];
}
if (file_exists($file = "$name-$l-$s.lang.php")) {
return $file;
}
if (isset($smap[$s])) {
$s = $smap[$s];
if (file_exists($file = "$name-$l-$s.lang.php")) {
return $file;
}
}
if (file_exists($file = "$name-$l.lang.php")) {
return $file;
}

Loading…
Cancel
Save