diff --git a/admin/common.php b/admin/common.php index 47f1924..cc077bd 100644 --- a/admin/common.php +++ b/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; } diff --git a/coverager/common-zh-simplified-gb2312.lang.php b/coverager/common-zh-simplified-gb2312.lang.php new file mode 100644 index 0000000..d085fb2 --- /dev/null +++ b/coverager/common-zh-simplified-gb2312.lang.php @@ -0,0 +1,25 @@ + '开始', + 'Directory' + => '目录', + 'File' + => '文件', + 'Percent' + => '覆盖率', + 'Hits' + => '命中', + 'Lines' + => '行数', + 'TODO' + => '闲置文件', + 'XCache PHP Code Coverage Viewer' + => 'XCache PHP 代码覆盖查看器', + 'module' + => '模块', + '' + => '', + ); + diff --git a/coverager/common.php b/coverager/common.php index 47f1924..cc077bd 100644 --- a/coverager/common.php +++ b/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; }