1
0
Fork 0

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
This commit is contained in:
Xuefer 2006-09-19 00:27:22 +00:00
parent c55a3bddf4
commit ce81573230
3 changed files with 51 additions and 6 deletions

View File

@ -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;
}

View File

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

View File

@ -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;
}