|
Packit |
667938 |
###### PATCHTAG00 ####################################################
|
|
Packit |
667938 |
### Simplified Chinese/简体中文
|
|
Packit |
667938 |
### => 黄华栋 <webmaster@kingisme.com>
|
|
Packit |
667938 |
### => QQ:582955 欢迎讨论FreeBSD
|
|
Packit |
667938 |
### => 修正了原来的错误.发布新版本.
|
|
Packit |
667938 |
###### PATCHTAG10 ####################################################
|
|
Packit |
667938 |
&chinese
|
|
Packit |
667938 |
###### PATCHTAG20 ####################################################
|
|
Packit |
667938 |
'chinese' => \&chinese,
|
|
Packit |
667938 |
'简体中文' => \&chinese,
|
|
Packit |
667938 |
###### PATCHTAG30 ####################################################
|
|
Packit |
667938 |
# Simplified Chinese/简体中文
|
|
Packit |
667938 |
'chinese' =>
|
|
Packit |
667938 |
"全新简体中文汉化:
|
|
Packit |
667938 |
黄华栋
|
|
Packit |
667938 |
<webmaster\@kingisme.com>",
|
|
Packit |
667938 |
###### PATCHTAG40 ####################################################
|
|
Packit |
667938 |
$credits::LOCALE{'简体中文'}=$credits::LOCALE{'Chinese'};
|
|
Packit |
667938 |
###### PATCHTAG50 ####################################################
|
|
Packit |
667938 |
# Simplified Chinese
|
|
Packit |
667938 |
|
|
Packit |
667938 |
sub chinese
|
|
Packit |
667938 |
{
|
|
Packit |
667938 |
my $string = shift;
|
|
Packit |
667938 |
return "" unless defined $string;
|
|
Packit |
667938 |
my(%translations,%month,%wday);
|
|
Packit |
667938 |
|
|
Packit |
667938 |
my($i,$j);
|
|
Packit |
667938 |
my(@dollar,@quux,@foo);
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
# regexp => replacement string NOTE does not use autovars $1,$2...
|
|
Packit |
667938 |
|
|
Packit |
667938 |
%translations =
|
|
Packit |
667938 |
(
|
|
Packit |
667938 |
'iso-8859-1' => 'gb2312',
|
|
Packit |
667938 |
'Maximal 5 Minute Incoming Traffic' => '5分钟最大流入量',
|
|
Packit |
667938 |
'Maximal 5 Minute Outgoing Traffic' => '5分钟最大流出量',
|
|
Packit |
667938 |
'the device' => '设备',
|
|
Packit |
667938 |
'The statistics were last updated(.*)' => '最后统计更新时间:$1',
|
|
Packit |
667938 |
' Average\)' => ' 平均)',
|
|
Packit |
667938 |
'Average' => '平均',
|
|
Packit |
667938 |
'Max' => '最大',
|
|
Packit |
667938 |
'Current' => '当前',
|
|
Packit |
667938 |
'version' => '版本',
|
|
Packit |
667938 |
'`Daily\' Graph \((.*) Minute' => '每日 图表 ($1 分钟',
|
|
Packit |
667938 |
'`Weekly\' Graph \(30 Minute' => '每周 图表 (30 分钟' ,
|
|
Packit |
667938 |
'`Monthly\' Graph \(2 Hour' => '每月 图表 (2 小时',
|
|
Packit |
667938 |
'`Yearly\' Graph \(1 Day' => '每年 图表 (1 天',
|
|
Packit |
667938 |
'Incoming Traffic in (\S+) per Second' => '每秒流入量 (单位 $1 )',
|
|
Packit |
667938 |
'Outgoing Traffic in (\S+) per Second' => '每秒流出量 (单位 $1 )',
|
|
Packit |
667938 |
'at which time (.*) had been up for(.*)' => ' $1 已运行了: $2 ',
|
|
Packit |
667938 |
'(.+)/s$' => '$1/秒',
|
|
Packit |
667938 |
'(.+)/min$' => '$1/分',
|
|
Packit |
667938 |
'(.+)/h$' => '$1/时',
|
|
Packit |
667938 |
# 'Bits' => 'Bits',
|
|
Packit |
667938 |
# 'Bytes' => 'Bytes'
|
|
Packit |
667938 |
'In' => '流入:',
|
|
Packit |
667938 |
'Out' => '流出:',
|
|
Packit |
667938 |
'Percentage' => '百分比:',
|
|
Packit |
667938 |
'Ported to OpenVMS Alpha by' => '移植到 OpenVMS 的是',
|
|
Packit |
667938 |
'Ported to WindowsNT by' => '移植到 WindowsNT 的是',
|
|
Packit |
667938 |
'and' => '与',
|
|
Packit |
667938 |
'^GREEN' => '绿色',
|
|
Packit |
667938 |
'BLUE' => '蓝色',
|
|
Packit |
667938 |
'DARK GREEN' => '墨绿',
|
|
Packit |
667938 |
'MAGENTA' => '紫色',
|
|
Packit |
667938 |
'AMBER' => '琥珀色'
|
|
Packit |
667938 |
);
|
|
Packit |
667938 |
|
|
Packit |
667938 |
# maybe expansions with replacement of whitespace would be more appropriate
|
|
Packit |
667938 |
|
|
Packit |
667938 |
foreach $i (keys %translations)
|
|
Packit |
667938 |
{
|
|
Packit |
667938 |
my $trans = $translations{$i};
|
|
Packit |
667938 |
$trans =~ s/\|/\|/;
|
|
Packit |
667938 |
return $string if eval " \$string =~ s|\${i}|${trans}| ";
|
|
Packit |
667938 |
};
|
|
Packit |
667938 |
|
|
Packit |
667938 |
%wday =
|
|
Packit |
667938 |
(
|
|
Packit |
667938 |
'Sunday' => '星期天', 'Sun' => '日',
|
|
Packit |
667938 |
'Monday' => '星期一', 'Mon' => '一',
|
|
Packit |
667938 |
'Tuesday' => '星期二', 'Tue' => '二',
|
|
Packit |
667938 |
'Wednesday' => '星期三', 'Wed' => '三',
|
|
Packit |
667938 |
'Thursday' => '星期四', 'Thu' => '四',
|
|
Packit |
667938 |
'Friday' => '星期五', 'Fri' => '五',
|
|
Packit |
667938 |
'Saturday' => '星期六', 'Sat' => '六'
|
|
Packit |
667938 |
|
|
Packit |
667938 |
);
|
|
Packit |
667938 |
|
|
Packit |
667938 |
%month =
|
|
Packit |
667938 |
(
|
|
Packit |
667938 |
'January' => ' 一 月', 'February' => ' 二 月', 'March' => ' 三 月',
|
|
Packit |
667938 |
'April' => ' 四 月', 'May' => ' 五 月', 'June' => ' 六 月',
|
|
Packit |
667938 |
'July' => ' 七 月', 'August' => ' 八 月', 'September' => ' 九 月',
|
|
Packit |
667938 |
'October' => ' 十 月', 'November' => '十一月', 'December' => '十二月',
|
|
Packit |
667938 |
'Jan' => '1月', 'Feb' => '2月', 'Mar' => '3月',
|
|
Packit |
667938 |
'Apr' => '4月', 'May' => '5月', 'Jun' => '6月',
|
|
Packit |
667938 |
'Jul' => '7月', 'Aug' => '8月', 'Sep' => '9月',
|
|
Packit |
667938 |
'Oct' => '10月', 'Nov' => '11月', 'Dec' => '12月'
|
|
Packit |
667938 |
|
|
Packit |
667938 |
);
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
@foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/);
|
|
Packit |
667938 |
if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} )
|
|
Packit |
667938 |
{
|
|
Packit |
667938 |
if($foo[3]=~(/(.*)at(.*)/))
|
|
Packit |
667938 |
{
|
|
Packit |
667938 |
@quux=split(/at/,$foo[3]);
|
|
Packit |
667938 |
$foo[3]=$quux[0];
|
|
Packit |
667938 |
$foo[4]=$quux[1];
|
|
Packit |
667938 |
};
|
|
Packit |
667938 |
return "$foo[3]年 $month{$foo[2]} $foo[1] 日 ,$wday{$foo[0]} ,$foo[4]";
|
|
Packit |
667938 |
};
|
|
Packit |
667938 |
|
|
Packit |
667938 |
#
|
|
Packit |
667938 |
# handle two different time/date formats:
|
|
Packit |
667938 |
# return "$wday, $mday $month ".($year+1900)." at $hour:$min";
|
|
Packit |
667938 |
# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT";
|
|
Packit |
667938 |
#
|
|
Packit |
667938 |
|
|
Packit |
667938 |
# handle nontranslated strings which ought to be translated
|
|
Packit |
667938 |
# print STDERR "$_\n" or print DEBUG "not translated $_";
|
|
Packit |
667938 |
# but then again we might not want/need to translate all strings
|
|
Packit |
667938 |
|
|
Packit |
667938 |
return $string;
|
|
Packit |
667938 |
|
|
Packit |
667938 |
};
|