From 1f9d32349193fd9efe9c39608447dcd52fe72db2 Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Tue, 18 Jan 2022 16:41:05 +0100 Subject: [PATCH] V2.17.9 rel (#83) * released version 2.17.9 --- src/CHANGES | 2 +- src/Makefile.in | 6 +- src/bin/cfgmaker | 6 +- src/bin/indexmaker | 8 +- src/bin/mrtg | 6 +- src/doc/mrtg-contrib.pod | 2 +- src/doc/mrtg-faq.pod | 4 +- src/doc/mrtg-mailer.pod | 1 + src/doc/mrtg-nt-guide.pod | 22 +- src/doc/mrtg-reference.pod | 2 +- src/doc/mrtg-unix-guide.pod | 8 +- src/doc/mrtglib.3 | 386 ++++++++++++++++++++ src/lib/mrtg2/MRTG_lib.pm | 2 +- src/lib/mrtg2/locales_mrtg.pm | 662 +++++++++++++++++----------------- src/src/rateup.c | 7 +- src/translate/locales_mrtg.pm | 662 +++++++++++++++++----------------- 16 files changed, 1087 insertions(+), 699 deletions(-) create mode 120000 src/doc/mrtg-mailer.pod create mode 100644 src/doc/mrtglib.3 diff --git a/src/CHANGES b/src/CHANGES index aae13d5..cc31546 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,4 +1,4 @@ -Changes 2.17.9, 2021-??-?? +Changes 2.17.9, 2022-01-18 -------------------------- From: tobi * add pid to lockfile and check if the pid is still running when trying to lock diff --git a/src/Makefile.in b/src/Makefile.in index 15cd524..3676ca4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ # things that the GNU standards document suggests all makefiles # should have. SHELL=/bin/sh -VER=2.17.8 +VER=2.17.9 .SUFFIXES: .SUFFIXES: .c .o .pl .pm .pod .man .1 .3 .txt @@ -147,8 +147,8 @@ dist: tar git tag v$(VER) git push --tags md5sum $(ARCHIVE).tar.gz >$(ARCHIVE).tar.gz.md5 - gpg -s $(ARCHIVE).tar.gz.md5 - chmod 644 $(ARCHIVE).tar.gz.md5* +# gpg -s $(ARCHIVE).tar.gz.md5 +# chmod 644 $(ARCHIVE).tar.gz.md5* scp CHANGES $(ARCHIVE).* oposs@freddie:public_html/mrtg/pub/ ssh oposs@freddie "cd public_html/mrtg/pub; rm mrtg.tar.gz;ln -s $(ARCHIVE).tar.gz mrtg.tar.gz" diff --git a/src/bin/cfgmaker b/src/bin/cfgmaker index cf33716..5d1c2fe 100755 --- a/src/bin/cfgmaker +++ b/src/bin/cfgmaker @@ -1,7 +1,7 @@ #! /home/oetiker/.plenv/shims/perl -w # -*- mode: Perl -*- ################################################################## -# MRTG 2.17.8 -- Config file creator +# MRTG 2.17.9 -- Config file creator ################################################################## # Created by Tobias Oetiker # this produces an mrtg config file for one router or more routers @@ -1282,7 +1282,7 @@ sub options ($$) { 'zero-speed=s', '<>', $addrouter_ornf) or pod2usage(2); - die("cfgmaker for mrtg-2.17.8\n") if $$opt{version}; + die("cfgmaker for mrtg-2.17.9\n") if $$opt{version}; pod2usage(-exitval => 0, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not keys %$routers; } # end options @@ -1589,7 +1589,7 @@ __END__ =head1 NAME -cfgmaker - Creates mrtg.cfg files (for mrtg-2.17.8) +cfgmaker - Creates mrtg.cfg files (for mrtg-2.17.9) =head1 SYNOPSIS diff --git a/src/bin/indexmaker b/src/bin/indexmaker index a238a66..5731667 100755 --- a/src/bin/indexmaker +++ b/src/bin/indexmaker @@ -1,7 +1,7 @@ #! /home/oetiker/.plenv/shims/perl -w # -*- mode: Perl -*- ################################################################## -# MRTG 2.17.8 --- Index Generator +# MRTG 2.17.9 --- Index Generator ################################################################## # # This reads a mrtg.cfg file form std input or cmdline argument @@ -527,7 +527,7 @@ ECHO # ----------------------------------------------------------- - my $VERSION = "2.17.8"; + my $VERSION = "2.17.9"; $index .= < @@ -636,7 +636,7 @@ sub options ($) { $$opt{prefix} .= '/'; $$opt{prefix} =~ s|/+$|/|; } - die ("Indexmaker for mrtg-2.17.8\n") if $$opt{version}; + die ("Indexmaker for mrtg-2.17.9\n") if $$opt{version}; pod2usage(-exitval => 1, -verbose => 2) if $$opt{man}; pod2usage(-verbose => 1) if not @ARGV; @@ -666,7 +666,7 @@ __END__ =head1 NAME -indexmaker - Creates index files for mrtg web sites (mrtg-2.17.8) +indexmaker - Creates index files for mrtg web sites (mrtg-2.17.9) =head1 SYNOPSIS diff --git a/src/bin/mrtg b/src/bin/mrtg index 8602c6a..6be3a78 100755 --- a/src/bin/mrtg +++ b/src/bin/mrtg @@ -2,7 +2,7 @@ # -*- mode: cperl -*- ################################################################### -# MRTG 2.17.8 Multi Router Traffic Grapher +# MRTG 2.17.9 Multi Router Traffic Grapher ################################################################### # Created by Tobias Oetiker # and Dave Rand @@ -1622,7 +1622,7 @@ sub writehtml { my $dirrel = "../" x ($$rcfg{'directory_web'}{$router} =~ tr|/|/|); $Today=&$LOC(datestr(time)); - $VERSION = "2.17.8"; + $VERSION = "2.17.9"; open (HTML,">$$cfg{'htmldir'}$$rcfg{'directory'}{$router}$router.$$rcfg{'extension'}{$router}") || do { warn ("$NOW: WARNING: Writing $router.$$rcfg{'extension'}{$router}: $!"); next }; @@ -2038,7 +2038,7 @@ sub printusage { print < -mrtg-2.17.8 - Multi Router Traffic Grapher +mrtg-2.17.9 - Multi Router Traffic Grapher Copyright 1995-2006 by Tobias Oetiker Licensed under the Gnu GPL. diff --git a/src/doc/mrtg-contrib.pod b/src/doc/mrtg-contrib.pod index 0b43aa6..d3f9b22 100644 --- a/src/doc/mrtg-contrib.pod +++ b/src/doc/mrtg-contrib.pod @@ -14,7 +14,7 @@ work. MRTG messages have been translated to a number of languages but there are still many which have not been covered yet. If you want to add yours, go -into the F directory and follow the instructions +into the F directory and follow the instructions given in the F file. =head2 Patches diff --git a/src/doc/mrtg-faq.pod b/src/doc/mrtg-faq.pod index 787e36f..221fe47 100644 --- a/src/doc/mrtg-faq.pod +++ b/src/doc/mrtg-faq.pod @@ -14,7 +14,7 @@ In the following sections you'll find some additional Frequently Asked Questions =head2 Why is there no "@#$%" (my native language) version of MRTG? Nobody has contributed a F<@#$%.pmd> file yet. Go into the -F directory and create your own translation file. +F directory and create your own translation file. When you are happy with it send it to me for inclusion with the next mrtg release. @@ -22,7 +22,7 @@ release. =head2 I need a script to make mrtg work with my xyz device. Probably this has already been done. Check the stuff in the -F directory. There is a file called F<00INDEX> in +F directory. There is a file called F<00INDEX> in that directory which tells what you can find in there. =head2 How does this SNMP thing work diff --git a/src/doc/mrtg-mailer.pod b/src/doc/mrtg-mailer.pod new file mode 120000 index 0000000..16c3bde --- /dev/null +++ b/src/doc/mrtg-mailer.pod @@ -0,0 +1 @@ +../bin/mrtg-mailer \ No newline at end of file diff --git a/src/doc/mrtg-nt-guide.pod b/src/doc/mrtg-nt-guide.pod index ecabdec..90af494 100644 --- a/src/doc/mrtg-nt-guide.pod +++ b/src/doc/mrtg-nt-guide.pod @@ -1,6 +1,6 @@ =head1 NAME -mrtg-nt-guide - The MRTG 2.17.8 Windows Installation Guide +mrtg-nt-guide - The MRTG 2.17.9 Windows Installation Guide =head1 SYNOPSIS @@ -24,7 +24,7 @@ http://www.activestate.com/store/activeperl/download/ =item * The latest version of MRTG from http://oss.oetiker.ch/mrtg/pub. Look for -mrtg-2.17.8.zip or better. The archive also contains a precompiled copy of +mrtg-2.17.9.zip or better. The archive also contains a precompiled copy of rateup.exe for Win32. @@ -40,7 +40,7 @@ to a LOCAL machine. =item First -Unzip MRTG to C:\mrtg-2.17.8 on the Windows machine of your choice. +Unzip MRTG to C:\mrtg-2.17.9 on the Windows machine of your choice. =item Next @@ -54,7 +54,7 @@ You can manually check this by going to [Control Panel]->[System]->[Environment] =back To see if everything is installed properly you can open a Command Shell -and go into F. Type: +and go into F. Type: perl mrtg @@ -89,7 +89,7 @@ Catalyst 5000) with Community string B. We are interested in monitoring traffic, and the CPU load. Let's begin. The first thing we do in setting up MRTG is making a default config file. -Get to a cmd prompt and change to the F directory. Type the +Get to a cmd prompt and change to the F directory. Type the following command: perl cfgmaker public@10.10.10.1 --global "WorkDir: c:\www\mrtg" --output mrtg.cfg @@ -157,7 +157,7 @@ This section determines how the web page headers will look #--------------------------------------------------------------- And that's a very basic MRTG config file. You can run this and see your -results by going into the F directory and typing: +results by going into the F directory and typing: perl mrtg mrtg.cfg @@ -186,7 +186,7 @@ Add the option to your mrtg.cfg file and start it with: - start /Dc:\mrtg-2.17.8\bin wperl mrtg --logging=eventlog mrtg.cfg + start /Dc:\mrtg-2.17.9\bin wperl mrtg --logging=eventlog mrtg.cfg If you use B instead of B, no console window will show. MRTG is now running in the background. If it runs into problems it will tell you so @@ -197,7 +197,7 @@ can be found in the event log. If you put a shortcut with Target: wperl mrtg --logging=eventlog mrtg.cfg - Start in: c:\mrtg-2.17.8\bin + Start in: c:\mrtg-2.17.9\bin into your start-up folder, MRTG will now start whenever you login to your NT box. @@ -246,7 +246,7 @@ Please complete the following steps before starting the installation: =item * -Copy B and B to c:\mrtg-2.17.8\bin\ (your MRTG bin directory). +Copy B and B to c:\mrtg-2.17.9\bin\ (your MRTG bin directory). =item * @@ -257,8 +257,8 @@ following content into it: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters] "Application"="c:\\perl\\bin\\wperl.exe" - "AppParameters"="c:\\mrtg-2.17.8\\bin\\mrtg --logging=eventlog c:\\mrtg-2.17.8\\bin\\mrtg.cfg" - "AppDirectory"="c:\\mrtg-2.17.8\\bin\\" + "AppParameters"="c:\\mrtg-2.17.9\\bin\\mrtg --logging=eventlog c:\\mrtg-2.17.9\\bin\\mrtg.cfg" + "AppDirectory"="c:\\mrtg-2.17.9\\bin\\" =back diff --git a/src/doc/mrtg-reference.pod b/src/doc/mrtg-reference.pod index e7c6336..0b43dce 100644 --- a/src/doc/mrtg-reference.pod +++ b/src/doc/mrtg-reference.pod @@ -1,6 +1,6 @@ =head1 NAME -mrtg-reference - MRTG 2.17.8 configuration reference +mrtg-reference - MRTG 2.17.9 configuration reference =head1 OVERVIEW diff --git a/src/doc/mrtg-unix-guide.pod b/src/doc/mrtg-unix-guide.pod index 4c3f69d..77e6f43 100644 --- a/src/doc/mrtg-unix-guide.pod +++ b/src/doc/mrtg-unix-guide.pod @@ -1,6 +1,6 @@ =head1 NAME -mrtg-unix-guide - The MRTG 2.17.8 Linux/Unix Installation Guide +mrtg-unix-guide - The MRTG 2.17.9 Linux/Unix Installation Guide =head1 DESCRIPTION @@ -160,8 +160,8 @@ For versions starting around 2.0.11, try: Ok, now everything is ready for the mrtg compilation. cd /usr/local/src - gunzip -c mrtg-2.17.8.tar.gz | tar xvf - - cd mrtg-2.17.8 + gunzip -c mrtg-2.17.9.tar.gz | tar xvf - + cd mrtg-2.17.9 If all the libraries have been preinstalled on your system you can configure mrtg by doing a simple: @@ -274,7 +274,7 @@ documentation of your system to make sure you get this right. A B script to put into F might look like this: #! /bin/sh - cd /usr/local/mrtg-2.17.8/bin && ./mrtg --user=mrtg-user \ + cd /usr/local/mrtg-2.17.9/bin && ./mrtg --user=mrtg-user \ /home/httpd/mrtg/mrtg.cfg --logging /var/log/mrtg.log diff --git a/src/doc/mrtglib.3 b/src/doc/mrtglib.3 new file mode 100644 index 0000000..1bb2def --- /dev/null +++ b/src/doc/mrtglib.3 @@ -0,0 +1,386 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "doc::mrtglib 3" +.TH doc::mrtglib 3 "2022-01-18" "2.17.9" "mrtg" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +MRTG_lib.pm \- Library for MRTG and support scripts +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 5 +\& use MRTG_lib; +\& my ($configfile, @target_names, %globalcfg, %targetcfg); +\& readcfg($configfile, \e@target_names, \e%globalcfg, \e%targetcfg); +\& my (@parsed_targets); +\& cfgcheck(\e@target_names, \e%globalcfg, \e%targetcfg, \e@parsed_targets); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +MRTG_lib is part of \s-1MRTG,\s0 the Multi Router Traffic Grapher. It was separated +from \s-1MRTG\s0 to allow other programs to easily use the same config files. The +main part of MRTG_lib is the config file parser but some other functions are +there too. +.ie n .IP "$MRTG_lib::OS" 4 +.el .IP "\f(CW$MRTG_lib::OS\fR" 4 +.IX Item "$MRTG_lib::OS" +Type of \s-1OS: WIN, UNIX, VMS\s0 +.ie n .IP "$MRTG_lib::SL" 4 +.el .IP "\f(CW$MRTG_lib::SL\fR" 4 +.IX Item "$MRTG_lib::SL" +\&\fISlash\fR in the current \s-1OS.\s0 +.ie n .IP "$MRTG_lib::PS" 4 +.el .IP "\f(CW$MRTG_lib::PS\fR" 4 +.IX Item "$MRTG_lib::PS" +Path separator in \s-1PATH\s0 variable +.ie n .IP """readcfg""" 4 +.el .IP "\f(CWreadcfg\fR" 4 +.IX Item "readcfg" +\&\f(CW\*(C`readcfg($file, \e@targets, \e%globalcfg, \e%targetcfg [, $prefix, \e%extrules])\*(C'\fR +.Sp +Reads a config file, parses it and fills some arrays and hashes. The +mandatory arguments are: the name of the config file, a ref to an array which +will be filled with a list of the target names, a hashref for the global +configuration, a hashref for the target configuration. +.Sp +The configuration file syntax is: +.Sp +.Vb 4 +\& globaloption: value +\& targetoption[targetname]: value +\& aprefix*extglobal: value +\& aprefix*exttarget[target2]: value +.Ve +.Sp +E.g. +.Sp +.Vb 3 +\& workdir: /var/stat/mrtg +\& target[router1]: 2:public@router1.local.net +\& 14all*columns: 2 +.Ve +.Sp +The global config hash has the structure +.Sp +.Vb 1 +\& $globalcfg{configoption} = \*(Aqvalue\*(Aq +.Ve +.Sp +The target config hash has the structure +.Sp +.Vb 1 +\& $targetcfg{configoption}{targetname} = \*(Aqvalue\*(Aq +.Ve +.Sp +See mrtg-reference for more information about the \s-1MRTG\s0 configuration syntax. +.Sp +\&\f(CW\*(C`readcfg\*(C'\fR can take two additional arguments to extend the config file +syntax. This allows programs to put their configuration into the mrtg config +file. The fifth argument is the prefix of the extension, the sixth argument +is a hash with the checkrules for these extension settings. E.g. if the +prefix is \*(L"14all\*(R" \f(CW\*(C`readcfg\*(C'\fR will check config lines that begin with +\&\*(L"14all*\*(R", i.e. all lines like +.Sp +.Vb 2 +\& 14all*columns: 2 +\& 14all*graphsize[target3]: 500 200 +.Ve +.Sp +against the rules in \f(CW%extrules\fR. The format of this hash is: +.Sp +.Vb 4 +\& $extrules{option} = [sub{$_[0] =~ m/^\ed+$/}, sub{"Error message for $_[0]"}] +\& i.e. +\& $extrules{option}[0] \-> a test expression +\& $extrules{option}[1] \-> error message if test fails +.Ve +.Sp +The first part of the array is a perl expression to test the value of the +option. The test can access this value in the variable \*(L"$arg\*(R". The second +part of the array is an error message to display when the test fails. The +failed value can be integrated by using the variable \*(L"$arg\*(R". +.Sp +Config settings with an different prefix than the one given in the \f(CW\*(C`readcfg\*(C'\fR +call are not checked but inserted into \fI\f(CI%globalcfg\fI\fR and \fI\f(CI%targetcfg\fI\fR. +Prefixed settings keep their prefix in the config hashes: +.Sp +.Vb 1 +\& $targetcfg{\*(Aq14all*graphsize\*(Aq}{\*(Aqtarget3\*(Aq} = \*(Aq500 200\*(Aq +.Ve +.ie n .IP """cfgcheck""" 4 +.el .IP "\f(CWcfgcheck\fR" 4 +.IX Item "cfgcheck" +\&\f(CW\*(C`cfgcheck(\e@target_names, \e%globalcfg, \e%targetcfg, \e@parsed_targets)\*(C'\fR +.Sp +Checks the configuration read by \f(CW\*(C`readcfg\*(C'\fR. Checks the values in the config +for syntactical and/or semantical errors. Sets defaults for some options. +Parses the \*(L"target[...]\*(R" options and files the array \f(CW@parsed_targets\fR ready +for mrtg functions. +.Sp +The first three arguments are the same as for \f(CW\*(C`readcfg\*(C'\fR. The fourth argument +is an arrayref which will be filled with the parsed target defs. +.Sp +\&\f(CW\*(C`cfgcheck\*(C'\fR converts the values of target settings \fIoptions\fR, e.g. +.Sp +.Vb 1 +\& options[router1]: bits, growright +.Ve +.Sp +to a hash: +.Sp +.Vb 2 +\& $targetcfg{\*(Aqoption\*(Aq}{\*(Aqbits\*(Aq}{\*(Aqrouter1\*(Aq} = 1 +\& $targetcfg{\*(Aqoption\*(Aq}{\*(Aqgrowright\*(Aq}{\*(Aqrouter1\*(Aq} = 1 +.Ve +.Sp +This is not done by \f(CW\*(C`readcfg\*(C'\fR so if you don't use \f(CW\*(C`cfgcheck\*(C'\fR you have to +check the scalar variable \fI\f(CI$targetcfg\fI{'option'}{'router1'}\fR (\s-1MRTG\s0 allows +options to be separated by space or ','). +.ie n .IP """ensureSL""" 4 +.el .IP "\f(CWensureSL\fR" 4 +.IX Item "ensureSL" +\&\f(CW\*(C`ensureSL(\e$pathname)\*(C'\fR +.Sp +Checks that the \fIpathname\fR does not contain double path separators and ends +with a path separator. It uses \f(CW$MRTG_lib::SL\fR as path separator which will be / +or \e depending on the \s-1OS.\s0 +.ie n .IP """log2rrd""" 4 +.el .IP "\f(CWlog2rrd\fR" 4 +.IX Item "log2rrd" +\&\f(CW\*(C`log2rrd ($router,\e%globalcfg,\e%targetcfg)\*(C'\fR +.Sp +Convert log file to rrd format. Needs rrdtool. +.ie n .IP """datestr""" 4 +.el .IP "\f(CWdatestr\fR" 4 +.IX Item "datestr" +\&\f(CW\*(C`datestr(time)\*(C'\fR +.Sp +Returns the time given in the argument as a nicely formatted date string. +The argument has to be in \s-1UNIX\s0 time format (seconds since 1970\-1\-1). +.ie n .IP """timestamp""" 4 +.el .IP "\f(CWtimestamp\fR" 4 +.IX Item "timestamp" +\&\f(CW\*(C`timestamp()\*(C'\fR +.Sp +Return a string representing the current time. +.ie n .IP """setup_loghandlers""" 4 +.el .IP "\f(CWsetup_loghandlers\fR" 4 +.IX Item "setup_loghandlers" +\&\f(CW\*(C`setup_loghandlers(filename)\*(C'\fR +.Sp +Install signalhandlers for _\|_DIE_\|_ and _\|_WARN_\|_ making the errors +go the the specified destination. If filename is 'eventlog' +mrtg will log to the windows event logger. +.ie n .IP """expistr""" 4 +.el .IP "\f(CWexpistr\fR" 4 +.IX Item "expistr" +\&\f(CW\*(C`expistr(time)\*(C'\fR +.Sp +Returns the time given in the argument formatted suitable for \s-1HTTP\s0 +Expire-Headers. +.ie n .IP """create_pid""" 4 +.el .IP "\f(CWcreate_pid\fR" 4 +.IX Item "create_pid" +\&\f(CW\*(C`create_pid()\*(C'\fR +.Sp +Creates a pid file for the mrtg daemon +.ie n .IP """demonize_me""" 4 +.el .IP "\f(CWdemonize_me\fR" 4 +.IX Item "demonize_me" +\&\f(CW\*(C`demonize_me()\*(C'\fR +.Sp +Puts the running program into background, detaching it from the terminal. +.ie n .IP """populatecache""" 4 +.el .IP "\f(CWpopulatecache\fR" 4 +.IX Item "populatecache" +\&\f(CW\*(C`populatecache(\e%confcache, $host, $reread, $snmpoptshash)\*(C'\fR +.Sp +Reads the \s-1SNMP\s0 variables \fIifDescr\fR, \fIipAdEntIfIndex\fR, \fIifPhysAddress\fR, \fIifName\fR from +the \fIhost\fR and stores the values in \fI\f(CI%confcache\fI\fR as follows: +.Sp +.Vb 5 +\& $confcache{$host}{\*(AqDescr\*(Aq}{ifDescr}{oid} = (ifDescr or \*(AqDup\*(Aq) +\& $confcache{$host}{\*(AqIP\*(Aq}{ipAdEntIfIndex}{oid} = (ipAdEntIfIndex or \*(AqDup\*(Aq) +\& $confcache{$host}{\*(AqEth\*(Aq}{ifPhysAddress}{oid} = (ifPhysAddress or \*(AqDup\*(Aq) +\& $confcache{$host}{\*(AqName\*(Aq}{ifName}{oid} = (ifName or \*(AqDup\*(Aq) +\& $confcache{$host}{\*(AqType\*(Aq}{ifType}{oid} = (ifType or \*(AqDup\*(Aq) +.Ve +.Sp +The value (at the right side of =) is 'Dup' if a value was retrieved +multiple times, the retrieved value else. +.ie n .IP """readconfcache""" 4 +.el .IP "\f(CWreadconfcache\fR" 4 +.IX Item "readconfcache" +\&\f(CW\*(C`my $confcache = readconfcache($file)\*(C'\fR +.Sp +Preload the confcache from a file. +.ie n .IP """readfromconfcache""" 4 +.el .IP "\f(CWreadfromconfcache\fR" 4 +.IX Item "readfromconfcache" +\&\f(CW\*(C`writeconfcache($confcache,$file)\*(C'\fR +.Sp +Store the current confcache into a file. +.ie n .IP """writeconfcache""" 4 +.el .IP "\f(CWwriteconfcache\fR" 4 +.IX Item "writeconfcache" +\&\f(CW\*(C`writeconfcache($confcache,$file)\*(C'\fR +.Sp +Store the current confcache into a file. +.ie n .IP """storeincache""" 4 +.el .IP "\f(CWstoreincache\fR" 4 +.IX Item "storeincache" +\&\f(CW\*(C`storeincache($confcache,$host,$method,$key,$value)\*(C'\fR +.ie n .IP """readfromcache""" 4 +.el .IP "\f(CWreadfromcache\fR" 4 +.IX Item "readfromcache" +\&\f(CW\*(C`readfromcache($confcache,$host,$method,$key)\*(C'\fR +.ie n .IP """clearfromcache""" 4 +.el .IP "\f(CWclearfromcache\fR" 4 +.IX Item "clearfromcache" +\&\f(CW\*(C`clearfromcache($confcache,$host)\*(C'\fR +.ie n .IP """debug""" 4 +.el .IP "\f(CWdebug\fR" 4 +.IX Item "debug" +\&\f(CW\*(C`debug($type, $message)\*(C'\fR +.Sp +Prints the \fImessage\fR on \s-1STDERR\s0 if debugging is enabled for type \fItype\fR. +A debug type is enabled if \fItype\fR is in array \f(CW@main::DEBUG\fR. +.SH "AUTHORS" +.IX Header "AUTHORS" +Rainer Bawidamann +.PP +(This Manpage) diff --git a/src/lib/mrtg2/MRTG_lib.pm b/src/lib/mrtg2/MRTG_lib.pm index 4a6530c..bf38c33 100644 --- a/src/lib/mrtg2/MRTG_lib.pm +++ b/src/lib/mrtg2/MRTG_lib.pm @@ -1,7 +1,7 @@ # -*- mode: Perl -*- package MRTG_lib; ################################################################### -# MRTG 2.17.8 Support library MRTG_lib.pm +# MRTG 2.17.9 Support library MRTG_lib.pm ################################################################### # Created by Tobias Oetiker # and Dave Rand diff --git a/src/lib/mrtg2/locales_mrtg.pm b/src/lib/mrtg2/locales_mrtg.pm index 9419179..f9ee2ac 100644 --- a/src/lib/mrtg2/locales_mrtg.pm +++ b/src/lib/mrtg2/locales_mrtg.pm @@ -61,10 +61,10 @@ ### and St茅phane Marzloff ### Galician/Galego ### => David Garabana Barro -### Chinese/中文简体 -### => Peter Wong 子荣 ### Chinese/简体汉字 ### => Zhanghui 张辉 +### Chinese/中文简体 +### => Peter Wong 子荣 ### German/Deutsch ### => Ilja Pavkovic ### Greek/Ellinika @@ -98,10 +98,10 @@ ### => Diogo Gomes ### Rom鉵/Romanian ### => J髗sef Szil醙yi -### Russian1251/畜耨觇1251 -### => 离尻襦礓 绣濑 ### Russian/蛘佑松 ### => 渫稍疑 笊琢夼嗡 +### Russian1251/畜耨觇1251 +### => 离尻襦礓 绣濑 ### Serbian/Srpski ### => Ratko Bucic ### Slovak/Slovensky @@ -114,10 +114,10 @@ ### => Clas Mayer ### Turkish/T黵k鏴 ### => 謟g黵 C. Demir -### Ukrainian/雨疣宽顸赅 -### => Olexander Kunytsa ### Ukrainian/跛伊迂肆 ### => 笈仪κ 缯挺桅滔咨 +### Ukrainian/雨疣宽顸赅 +### => Olexander Kunytsa ### ### Contributions and fixes by: ### @@ -163,8 +163,8 @@ $VERSION = '0.07'; &german &french &galician - &gb2312 &gb + &gb2312 &german &greek &hungarian @@ -180,16 +180,16 @@ $VERSION = '0.07'; &polish &portuguese &romanian - &russian1251 &russian + &russian1251 &serbian &slovak &slovenian &spanish &swedish &turkish - &ukrainian1251 &ukrainian + &ukrainian1251 ); %lang2tran::LOCALE= @@ -228,10 +228,10 @@ $VERSION = '0.07'; 'francais' => \&french, 'galician' => \&galician, 'galego' => \&galician, - 'gb2312' => \&gb2312, - '中文简体' => \&gb2312, 'gb' => \&gb, '简体汉字' => \&gb, + 'gb2312' => \&gb2312, + '中文简体' => \&gb2312, 'german' => \&german, 'german' => \&german, 'greek' => \&greek, @@ -260,10 +260,10 @@ $VERSION = '0.07'; 'portuguese' => \&portuguese, 'romanian' => \&romanian, 'rom鉵' => \&romanian, - 'russian1251' => \&russian1251, - '畜耨觇1251' => \&russian1251, 'russian' => \&russian, '蛘佑松' => \&russian, + 'russian1251' => \&russian1251, + '畜耨觇1251' => \&russian1251, 'serbian' => \&serbian, 'slovak' => \&slovak, 'slovenian' => \&slovenian, @@ -273,10 +273,10 @@ $VERSION = '0.07'; 'svenska' => \&swedish, 'turkish' => \&turkish, 'turkce' => \&turkish, - 'ukrainian1251' => \&ukrainian1251, - '雨疣宽顸赅1251' => \&ukrainian1251, 'ukrainian' => \&ukrainian, '跛伊迂肆' => \&ukrainian, + 'ukrainian1251' => \&ukrainian1251, + '雨疣宽顸赅1251' => \&ukrainian1251, ); %credits::LOCALE= @@ -381,16 +381,16 @@ $VERSION = '0.07'; "Traducido ao galego por David Garabana Barro <dgaraban\@arrakis.es>", -# Chinese/中文简体 - 'gb2312' => - "中文化作者 - Peter Wong - &webmaster\@tcpip.com.cn>", # Chinese/简体汉字 'gb' => "いゅて Hui Zhang <zhanghui\@asiainfo.com>", +# Chinese/中文简体 + 'gb2312' => + "中文化作者 + Peter Wong + &webmaster\@tcpip.com.cn>", # German/deutsch 'german' => "Vorbereitet für die Lokalisation von @@ -470,16 +470,16 @@ $VERSION = '0.07'; "Tradus de J髗sef Szil醙yi <jozsi\@maxiq.ro>", -# Russian1251/畜耨觇1251 - 'russian1251' => - "襄疱忸 磬 痼耨觇 琨 (觐滂痤怅 1251): - 离尻襦礓 绣濑 - <aredyuk\@irmcity.com>", # Russian/蛘佑松 'russian' => "鹋遗紫 瘟 艺佑松 掩偎: 渫稍疑 笊琢夼嗡 <mitya\@cavia.pp.ru>", +# Russian1251/畜耨觇1251 + 'russian1251' => + "襄疱忸 磬 痼耨觇 琨 (觐滂痤怅 1251): + 离尻襦礓 绣濑 + <aredyuk\@irmcity.com>", # Serbian/Srpski 'serbian' => "Ported to Serbian by / Srpski prevod uradio: @@ -509,16 +509,16 @@ $VERSION = '0.07'; 'turkish' => "T黵k鏴le⺶iren 謟g黵 C. Demir", -# Ukrainian1251/雨疣宽顸赅1251 - 'ukrainian1251' => - "襄疱觌噤 箨疣宽顸觐 (cp1251): - 坞尻襦礓 鼠龛 - <xakep\@snark.ukma.kiev.ua>", # Ukrainian/跛伊迂肆 'ukrainian' => "鹋遗颂聊 瘟 账伊迂苏 拖渍: 笈仪κ 缯挺桅滔咨 <gray\@arte-fact.net>", +# Ukrainian1251/雨疣宽顸赅1251 + 'ukrainian1251' => + "襄疱觌噤 箨疣宽顸觐 (cp1251): + 坞尻襦礓 鼠龛 + <xakep\@snark.ukma.kiev.ua>", ); $credits::LOCALE{'斜械谢邪褉褍褋泻邪褟'}=$credits::LOCALE{'belarusian'}; @@ -538,8 +538,8 @@ $credits::LOCALE{'euc-jp'}=$credits::LOCALE{'eucjp'}; $credits::LOCALE{'finnish'}=$credits::LOCALE{'finnish'}; $credits::LOCALE{'francais'}=$credits::LOCALE{'french'}; $credits::LOCALE{'galego'}=$credits::LOCALE{'galician'}; -$credits::LOCALE{'中文简体'}=$credits::LOCALE{'gb2312'}; $credits::LOCALE{'简体汉字'}=$credits::LOCALE{'gb'}; +$credits::LOCALE{'中文简体'}=$credits::LOCALE{'gb2312'}; $credits::LOCALE{'deutsch'}=$credits::LOCALE{'german'}; $credits::LOCALE{'ellinika'}=$credits::LOCALE{'greek'}; $credits::LOCALE{'magyar'}=$credits::LOCALE{'hungarian'}; @@ -555,16 +555,16 @@ $credits::LOCALE{'norsk'}=$credits::LOCALE{'norwegian'}; $credits::LOCALE{'polski'}=$credits::LOCALE{'polish'}; $credits::LOCALE{'portuguese'}=$credits::LOCALE{'portuguese'}; $credits::LOCALE{'rom鉵'}=$credits::LOCALE{'romanian'}; -$credits::LOCALE{'畜耨觇1251'}=$credits::LOCALE{'russian1251'}; $credits::LOCALE{'蛘佑松'}=$credits::LOCALE{'russian'}; +$credits::LOCALE{'畜耨觇1251'}=$credits::LOCALE{'russian1251'}; $credits::LOCALE{'serbian'}=$credits::LOCALE{'serbian'}; $credits::LOCALE{'slovak'}=$credits::LOCALE{'slovak'}; $credits::LOCALE{'slovenian'}=$credits::LOCALE{'slovenian'}; $credits::LOCALE{'espanol'}=$credits::LOCALE{'spanish'}; $credits::LOCALE{'svenska'}=$credits::LOCALE{'swedish'}; $credits::LOCALE{'turkce'}=$credits::LOCALE{'turkish'}; -$credits::LOCALE{'雨疣宽顸赅1251'}=$credits::LOCALE{'ukrainian1251'}; $credits::LOCALE{'跛伊迂肆'}=$credits::LOCALE{'ukrainian'}; +$credits::LOCALE{'雨疣宽顸赅1251'}=$credits::LOCALE{'ukrainian1251'}; # English - default sub english @@ -2458,9 +2458,9 @@ foreach $i (keys %translations) return $string; }; -# Chinese gb2312 Code +# Chinese gb Code -sub gb2312 +sub gb { my $string = shift; return "" unless defined $string; @@ -2475,39 +2475,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'gb2312', - 'Maximal 5 Minute Incoming Traffic' => '5分钟最大流入量', - 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大流出量', - 'the device' => '装置', - 'The statistics were last updated(.*)' => '上次统计更新时间: $1', - ' Average\)' => ' 平均)', + 'iso-8859-1' => 'gb', + 'Maximal 5 Minute Incoming Traffic' => '5分钟最大的流量', + 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大的流出流量', + 'the device' => '当前设备', + 'The statistics were last updated(.*)' => '统计信息更新于: $1', + ' Average\)' => '平均)', 'Average' => '平均', 'Max' => '最大', - 'Current' => '目前', + 'Current' => '当前', 'version' => '版本', - '`Daily\' Graph \((.*) Minute' => '每日 图表 ($1 分钟', - '`Weekly\' Graph \(30 Minute' => '每周 图表 (30 分钟' , - '`Monthly\' Graph \(2 Hour' => '每月 图表 (2 小时', - '`Yearly\' Graph \(1 Day' => '每年 图表 (1 天', - 'Incoming Traffic in (\S+) per Second' => '每秒流入量 (单位 $1)', - 'Outgoing Traffic in (\S+) per Second' => '每秒流出量 (单位 $1)', - 'at which time (.*) had been up for(.*)' => '设备名称 $1,已运作时间(UPTIME): $2', - '([kMG]?)([bB])/s' => '\$1\$2/秒', - '([kMG]?)([bB])/min' => '\$1\$2/分', - '([kMG]?)([bB])/h' => '$1$2/时', + '`Daily\' Graph \((.*) Minute' => '日分析图($1分钟', + '`Weekly\' Graph \(30 Minute' => '周分析图(30分钟' , + '`Monthly\' Graph \(2 Hour' => '月分析图(2小时', + '`Yearly\' Graph \(1 Day' => '年分析图(1天', + 'Incoming Traffic in (\S+) per Second' => '每秒的流入流量(单位$1)', + 'Outgoing Traffic in (\S+) per Second' => '每秒的流出流量(单位$1)', + 'at which time (.*) had been up for(.*)' => '其时 $1已经更新(UPTIME): $2', + '([kMG]?)([bB])/s' => '$1$2/s', + '([kMG]?)([bB])/min' => '$1$2/m', + '([kMG]?)([bB])/h' => '$1$2/h', # 'Bits' => 'Bits', # 'Bytes' => 'Bytes' 'In' => '流入', 'Out' => '流出', 'Percentage' => '百分比', - 'Ported to OpenVMS Alpha by' => '移植到 OpenVM Alpha 作者', - 'Ported to WindowsNT by' => '移植到 WindowsNT 作者', - 'and' => '及', + 'Ported to OpenVMS Alpha by' => 'OpenVMS的端口', + 'Ported to WindowsNT by' => 'WindowsNT的端口', + 'and' => '与', '^GREEN' => '绿色', - 'BLUE' => '蓝色', - 'DARK GREEN' => '墨绿色', - 'MAGENTA' => '紫色', - 'AMBER' => '琥珀色' + 'BLUE' => '兰色', + 'DARK GREEN' => '暗绿', + 'MAGENTA' => '褐色', + 'AMBER' => '紫色' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -2521,26 +2521,26 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => '星期天', 'Sun' => '日', - 'Monday' => '星期一', 'Mon' => '一', - 'Tuesday' => '星期二', 'Tue' => '二', - 'Wednesday' => '星期三', 'Wed' => '三', - 'Thursday' => '星期四', 'Thu' => '四', - 'Friday' => '星期五', 'Fri' => '五', - 'Saturday' => '星期六', 'Sat' => '六' + 'Sunday' => '周日', 'Sun' => '周日', + 'Monday' => '周一', 'Mon' => '周一', + 'Tuesday' => '周二', 'Tue' => '周二', + 'Wednesday' => '周三', 'Wed' => '周三', + 'Thursday' => '周四', 'Thu' => '周四', + 'Friday' => '周五', 'Fri' => '周五', + 'Saturday' => '周六', 'Sat' => '周六' ); %month = ( - 'January' => '一月', 'February' => '二月', 'March' => '三月', - 'Jan' => '一', 'Feb' => '二', 'Mar' => '三', - 'April' => '四月', 'May' => '五月', 'June' => '六月', - 'Apr' => '四', 'May' => '五', 'Jun' => '六', - 'July' => '七月', 'August' => '八月', 'September' => '九月', - 'Jul' => '七', 'Aug' => '八', 'Sep' => '九', - 'October' => '十月', 'November' => '十一月', 'December' => '十二月', - 'Oct' => '十', 'Nov' => '十一', 'Dec' => '十二' + 'January' => '1月', 'February' => '2月', 'March' => '3月', + 'Jan' => '1月', 'Feb' => '2月', 'Mar' => '3月', + 'April' => '4月', 'May' => '5月', 'June' => '6月', + 'Apr' => '4月', 'May' => '5月', 'Jun' => '6月', + 'July' => '7月', 'August' => '8月', 'September' => '9月', + 'Jul' => '7月', 'Aug' => '8月', 'Sep' => '9月', + 'October' => '10月', 'November' => '11月', 'December' => '12月', + 'Oct' => '10月', 'Nov' => '11月', 'Dec' => '12月' ); @@ -2554,7 +2554,7 @@ foreach $i (keys %translations) $foo[3]=$quux[0]; $foo[4]=$quux[1]; }; - return "$foo[3] $month{$foo[2]} $foo[1] 日, $wday{$foo[0]}, $foo[4]"; + return "$foo[3]年 $month{$foo[2]} $foo[1]日, $wday{$foo[0]}, $foo[4]"; }; # @@ -2570,9 +2570,9 @@ foreach $i (keys %translations) return $string; }; -# Chinese gb Code +# Chinese gb2312 Code -sub gb +sub gb2312 { my $string = shift; return "" unless defined $string; @@ -2587,39 +2587,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'gb', - 'Maximal 5 Minute Incoming Traffic' => '5分钟最大的流量', - 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大的流出流量', - 'the device' => '当前设备', - 'The statistics were last updated(.*)' => '统计信息更新于: $1', - ' Average\)' => '平均)', + 'iso-8859-1' => 'gb2312', + 'Maximal 5 Minute Incoming Traffic' => '5分钟最大流入量', + 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大流出量', + 'the device' => '装置', + 'The statistics were last updated(.*)' => '上次统计更新时间: $1', + ' Average\)' => ' 平均)', 'Average' => '平均', 'Max' => '最大', - 'Current' => '当前', + 'Current' => '目前', 'version' => '版本', - '`Daily\' Graph \((.*) Minute' => '日分析图($1分钟', - '`Weekly\' Graph \(30 Minute' => '周分析图(30分钟' , - '`Monthly\' Graph \(2 Hour' => '月分析图(2小时', - '`Yearly\' Graph \(1 Day' => '年分析图(1天', - 'Incoming Traffic in (\S+) per Second' => '每秒的流入流量(单位$1)', - 'Outgoing Traffic in (\S+) per Second' => '每秒的流出流量(单位$1)', - 'at which time (.*) had been up for(.*)' => '其时 $1已经更新(UPTIME): $2', - '([kMG]?)([bB])/s' => '$1$2/s', - '([kMG]?)([bB])/min' => '$1$2/m', - '([kMG]?)([bB])/h' => '$1$2/h', + '`Daily\' Graph \((.*) Minute' => '每日 图表 ($1 分钟', + '`Weekly\' Graph \(30 Minute' => '每周 图表 (30 分钟' , + '`Monthly\' Graph \(2 Hour' => '每月 图表 (2 小时', + '`Yearly\' Graph \(1 Day' => '每年 图表 (1 天', + 'Incoming Traffic in (\S+) per Second' => '每秒流入量 (单位 $1)', + 'Outgoing Traffic in (\S+) per Second' => '每秒流出量 (单位 $1)', + 'at which time (.*) had been up for(.*)' => '设备名称 $1,已运作时间(UPTIME): $2', + '([kMG]?)([bB])/s' => '\$1\$2/秒', + '([kMG]?)([bB])/min' => '\$1\$2/分', + '([kMG]?)([bB])/h' => '$1$2/时', # 'Bits' => 'Bits', # 'Bytes' => 'Bytes' 'In' => '流入', 'Out' => '流出', 'Percentage' => '百分比', - 'Ported to OpenVMS Alpha by' => 'OpenVMS的端口', - 'Ported to WindowsNT by' => 'WindowsNT的端口', - 'and' => '与', + 'Ported to OpenVMS Alpha by' => '移植到 OpenVM Alpha 作者', + 'Ported to WindowsNT by' => '移植到 WindowsNT 作者', + 'and' => '及', '^GREEN' => '绿色', - 'BLUE' => '兰色', - 'DARK GREEN' => '暗绿', - 'MAGENTA' => '褐色', - 'AMBER' => '紫色' + 'BLUE' => '蓝色', + 'DARK GREEN' => '墨绿色', + 'MAGENTA' => '紫色', + 'AMBER' => '琥珀色' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -2633,26 +2633,26 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => '周日', 'Sun' => '周日', - 'Monday' => '周一', 'Mon' => '周一', - 'Tuesday' => '周二', 'Tue' => '周二', - 'Wednesday' => '周三', 'Wed' => '周三', - 'Thursday' => '周四', 'Thu' => '周四', - 'Friday' => '周五', 'Fri' => '周五', - 'Saturday' => '周六', 'Sat' => '周六' + 'Sunday' => '星期天', 'Sun' => '日', + 'Monday' => '星期一', 'Mon' => '一', + 'Tuesday' => '星期二', 'Tue' => '二', + 'Wednesday' => '星期三', 'Wed' => '三', + 'Thursday' => '星期四', 'Thu' => '四', + 'Friday' => '星期五', 'Fri' => '五', + 'Saturday' => '星期六', 'Sat' => '六' ); %month = ( - 'January' => '1月', 'February' => '2月', 'March' => '3月', - 'Jan' => '1月', 'Feb' => '2月', 'Mar' => '3月', - 'April' => '4月', 'May' => '5月', 'June' => '6月', - 'Apr' => '4月', 'May' => '5月', 'Jun' => '6月', - 'July' => '7月', 'August' => '8月', 'September' => '9月', - 'Jul' => '7月', 'Aug' => '8月', 'Sep' => '9月', - 'October' => '10月', 'November' => '11月', 'December' => '12月', - 'Oct' => '10月', 'Nov' => '11月', 'Dec' => '12月' + 'January' => '一月', 'February' => '二月', 'March' => '三月', + 'Jan' => '一', 'Feb' => '二', 'Mar' => '三', + 'April' => '四月', 'May' => '五月', 'June' => '六月', + 'Apr' => '四', 'May' => '五', 'Jun' => '六', + 'July' => '七月', 'August' => '八月', 'September' => '九月', + 'Jul' => '七', 'Aug' => '八', 'Sep' => '九', + 'October' => '十月', 'November' => '十一月', 'December' => '十二月', + 'Oct' => '十', 'Nov' => '十一', 'Dec' => '十二' ); @@ -2666,7 +2666,7 @@ foreach $i (keys %translations) $foo[3]=$quux[0]; $foo[4]=$quux[1]; }; - return "$foo[3]年 $month{$foo[2]} $foo[1]日, $wday{$foo[0]}, $foo[4]"; + return "$foo[3] $month{$foo[2]} $foo[1] 日, $wday{$foo[0]}, $foo[4]"; }; # @@ -4361,9 +4361,11 @@ foreach $i (keys %translations) return $string; }; -# Russian1251 Code -sub russian1251 + +# Russian + +sub russian { my $string = shift; return "" unless defined $string; @@ -4378,41 +4380,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'windows-1251', - 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯 怩钿 蝠圄桕 玎 5 扈眢', - 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯 桉躅 蝠圄桕 玎 5 扈眢', - 'the device' => '篑蝠铋耱忸', - 'The statistics were last updated(.*)' => '吗屐 镱耠邃礤泐 钺眍怆屙: $1', + 'iso-8859-1' => 'koi8-r', + 'Maximal 5 Minute Incoming Traffic' => '砹擞赏撂匚偈 兹夏演墒 砸疗伤 诹 5 蜕握', + 'Maximal 5 Minute Outgoing Traffic' => '砹擞赏撂匚偈 捎认难萆 砸疗伤 诹 5 蜕握', + 'the device' => '沼砸鲜釉紫', + 'The statistics were last updated(.*)' => '鹣犹拍闻 下蜗滋盼膳 釉猎捎陨松: $1', ' Average\)' => ')', - 'Average' => ' 耩邃礤', - 'Max' => '锑犟桁嚯', - 'Current' => '彦轺囫', - 'version' => '忮瘃', - '`Daily\' Graph \((.*) Minute' => '洋蝾黜 沭圄桕 (耩邃礤 玎 $1 扈眢', - '`Weekly\' Graph \(30 Minute' => '湾溴朦睇 沭圄桕 (耩邃礤 玎 30 扈眢' , - '`Monthly\' Graph \(2 Hour' => '体黜 沭圄桕 (耩邃礤 玎 2 鬣襦', - '`Yearly\' Graph \(1 Day' => '妙漕忸 沭圄桕 (耩邃礤 玎 1 溴睃', - 'Incoming Traffic in (\S+) per Second' => '迈钿 蝠圄桕 $1 皴牦礓', - 'Outgoing Traffic in (\S+) per Second' => '锐躅 蝠圄桕 $1 皴牦礓', - 'at which time (\S+) had been up for (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2.', - 'at which time (\S+) had been up for (\S+) day, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蜿, $3.', - 'at which time (\S+) had been up for (\S+) days, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蝾, $3.', - #'([kMG]?)([bB])/s' => '$1$1/皴', - #'([kMG]?)([bB])/min' => '$1$2/扈', - '([kMG]?)([bB])/h' => '$1$2/鬣', - 'Bits' => '徼蜞', - 'Bytes' => '徉轵圊', - 'In' => '迈', - 'Out' => '锐', - 'Percentage' => '橡铞屙螓', - 'Ported to OpenVMS Alpha by' => '冷囡蜩痤忄眍 潆 OpenVMS Alpha', - 'Ported to WindowsNT by' => '冷囡蜩痤忄眍 潆 WindowsNT', - 'and' => '', - '^GREEN' => '桥伺哇', - 'BLUE' => '讶腿', - 'DARK GREEN' => '遗掏吻潘磐凵', - 'MAGENTA' => '匀嗡乓温凵', - 'AMBER' => '咄依型凵' + 'Average' => '笠拍紊', + 'Max' => '砹擞.', + 'Current' => '襞苏萆', + 'version' => '着矣裳', + '`Daily\' Graph \((.*) Minute' => '笳韵尬偈 且疗伤 (右拍闻 诹 $1 蜕握', + '`Weekly\' Graph \(30 Minute' => '钆呐特钨 且疗伤 (右拍闻 诹 30 蜕握' , + '`Monthly\' Graph \(2 Hour' => '砼友尬偈 且疗伤 (右拍闻 诹 2 蘖恿', + '`Yearly\' Graph \(1 Day' => '缦南紫 且疗伤 (右拍闻 诹 1 呐呜', + 'Incoming Traffic in (\S+) per Second' => '魅夏演墒 砸疗伤 $1 优苏文', + 'Outgoing Traffic in (\S+) per Second' => '橛认难萆 砸疗伤 $1 优苏文', + 'at which time (.*) had been up for(.*)' => ' 茉 滓磐 $1 沦塘 姿汤夼瘟 $2', + #'([kMG]?)([bB])/s' => '$1$1/优', + #'([kMG]?)([bB])/min' => '$1$2/蜕', + '([kMG]?)([bB])/h' => '$1$2/蘖', + 'Bits' => '律粤', + 'Bytes' => '铝试寥', + 'In' => '魅', + 'Out' => '橛', + 'Percentage' => '鹨厦盼再', + 'Ported to OpenVMS Alpha by' => '崮列陨蚁琢蜗 奶 OpenVMS Alpha', + 'Ported to WindowsNT by' => '崮列陨蚁琢蜗 奶 WindowsNT', + 'and' => '', + '^GREEN' => '戾铢', + 'BLUE' => '箝铋', + 'DARK GREEN' => '翦眍嵇屐孱', + 'MAGENTA' => '骈镬弭秣', + 'AMBER' => '耦翎蝾' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -4426,25 +4426,25 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => ' 骂耜疱皴睃', 'Sun' => '埋', - 'Monday' => ' 项礤溴朦龛', 'Mon' => '享', - 'Tuesday' => ' 买铕龛', 'Tue' => '买', - 'Wednesday' => ' 佯邃', 'Wed' => '佯', - 'Thursday' => ' 族蜮屦', 'Thu' => '昨', - 'Friday' => ' 蝽桷', 'Fri' => '向', - 'Saturday' => ' 洋後铗', 'Sat' => '厌' + 'Sunday' => ' 飨铀遗优呜', 'Sun' => '饔', + 'Monday' => ' 鹣闻呐特紊', 'Mon' => '鹞', + 'Tuesday' => ' 髟弦紊', 'Tue' => '髟', + 'Wednesday' => ' 笠拍', 'Wed' => '笠', + 'Thursday' => ' 宰乓', 'Thu' => '', + 'Friday' => ' 鹧晕擅', 'Fri' => '鹪', + 'Saturday' => ' 笳侣显', 'Sat' => '舐' ); %month = ( - 'January' => '唔忄', 'February' => '藻怵嚯' , 'March' => '锑痱', - 'Jan' => '唔', 'Feb' => '藻', 'Mar' => '锑', - 'April' => '里疱', 'May' => '锑', 'June' => '叁', - 'Apr' => '里', 'May' => '锑', 'Jun' => '叁', - 'July' => '叁', 'August' => '棱泱耱', 'September' => '彦眚狃', - 'Jul' => '叁', 'Aug' => '棱', 'Sep' => '彦', - 'October' => '侮狃', 'November' => '皖狃', 'December' => '腻赅狃', - 'Oct' => '侮', 'Nov' => '皖', 'Dec' => '腻' + 'January' => '裎琢已', 'February' => '媾滓撂' , 'March' => '砹以', + 'Jan' => '裎', 'Feb' => '媾', 'Mar' => '砹', + 'April' => '嵝遗萄', 'May' => '砹', 'June' => '槔窝', + 'Apr' => '嵝', 'May' => '砹', 'Jun' => '槔', + 'July' => '槔萄', 'August' => '嶙钦釉', 'September' => '笈卧崖已', + 'Jul' => '槔', 'Aug' => '嶙', 'Sep' => '笈', + 'October' => '锼匝乱', 'November' => '钕崖已', 'December' => '渑肆乱', + 'Oct' => '锼', 'Nov' => '钕', 'Dec' => '渑' ); @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); @@ -4453,7 +4453,7 @@ foreach $i (keys %translations) if($foo[3]=~(/(.*)at(.*)/)) { @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; + $foo[3]=$quux[0].". ".$quux[1]; }; return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; }; @@ -4471,11 +4471,9 @@ foreach $i (keys %translations) return $string; }; +# Russian1251 Code - -# Russian - -sub russian +sub russian1251 { my $string = shift; return "" unless defined $string; @@ -4490,39 +4488,41 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'koi8-r', - 'Maximal 5 Minute Incoming Traffic' => '砹擞赏撂匚偈 兹夏演墒 砸疗伤 诹 5 蜕握', - 'Maximal 5 Minute Outgoing Traffic' => '砹擞赏撂匚偈 捎认难萆 砸疗伤 诹 5 蜕握', - 'the device' => '沼砸鲜釉紫', - 'The statistics were last updated(.*)' => '鹣犹拍闻 下蜗滋盼膳 釉猎捎陨松: $1', + 'iso-8859-1' => 'windows-1251', + 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯 怩钿 蝠圄桕 玎 5 扈眢', + 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯 桉躅 蝠圄桕 玎 5 扈眢', + 'the device' => '篑蝠铋耱忸', + 'The statistics were last updated(.*)' => '吗屐 镱耠邃礤泐 钺眍怆屙: $1', ' Average\)' => ')', - 'Average' => '笠拍紊', - 'Max' => '砹擞.', - 'Current' => '襞苏萆', - 'version' => '着矣裳', - '`Daily\' Graph \((.*) Minute' => '笳韵尬偈 且疗伤 (右拍闻 诹 $1 蜕握', - '`Weekly\' Graph \(30 Minute' => '钆呐特钨 且疗伤 (右拍闻 诹 30 蜕握' , - '`Monthly\' Graph \(2 Hour' => '砼友尬偈 且疗伤 (右拍闻 诹 2 蘖恿', - '`Yearly\' Graph \(1 Day' => '缦南紫 且疗伤 (右拍闻 诹 1 呐呜', - 'Incoming Traffic in (\S+) per Second' => '魅夏演墒 砸疗伤 $1 优苏文', - 'Outgoing Traffic in (\S+) per Second' => '橛认难萆 砸疗伤 $1 优苏文', - 'at which time (.*) had been up for(.*)' => ' 茉 滓磐 $1 沦塘 姿汤夼瘟 $2', - #'([kMG]?)([bB])/s' => '$1$1/优', - #'([kMG]?)([bB])/min' => '$1$2/蜕', - '([kMG]?)([bB])/h' => '$1$2/蘖', - 'Bits' => '律粤', - 'Bytes' => '铝试寥', - 'In' => '魅', - 'Out' => '橛', - 'Percentage' => '鹨厦盼再', - 'Ported to OpenVMS Alpha by' => '崮列陨蚁琢蜗 奶 OpenVMS Alpha', - 'Ported to WindowsNT by' => '崮列陨蚁琢蜗 奶 WindowsNT', - 'and' => '', - '^GREEN' => '戾铢', - 'BLUE' => '箝铋', - 'DARK GREEN' => '翦眍嵇屐孱', - 'MAGENTA' => '骈镬弭秣', - 'AMBER' => '耦翎蝾' + 'Average' => ' 耩邃礤', + 'Max' => '锑犟桁嚯', + 'Current' => '彦轺囫', + 'version' => '忮瘃', + '`Daily\' Graph \((.*) Minute' => '洋蝾黜 沭圄桕 (耩邃礤 玎 $1 扈眢', + '`Weekly\' Graph \(30 Minute' => '湾溴朦睇 沭圄桕 (耩邃礤 玎 30 扈眢' , + '`Monthly\' Graph \(2 Hour' => '体黜 沭圄桕 (耩邃礤 玎 2 鬣襦', + '`Yearly\' Graph \(1 Day' => '妙漕忸 沭圄桕 (耩邃礤 玎 1 溴睃', + 'Incoming Traffic in (\S+) per Second' => '迈钿 蝠圄桕 $1 皴牦礓', + 'Outgoing Traffic in (\S+) per Second' => '锐躅 蝠圄桕 $1 皴牦礓', + 'at which time (\S+) had been up for (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2.', + 'at which time (\S+) had been up for (\S+) day, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蜿, $3.', + 'at which time (\S+) had been up for (\S+) days, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蝾, $3.', + #'([kMG]?)([bB])/s' => '$1$1/皴', + #'([kMG]?)([bB])/min' => '$1$2/扈', + '([kMG]?)([bB])/h' => '$1$2/鬣', + 'Bits' => '徼蜞', + 'Bytes' => '徉轵圊', + 'In' => '迈', + 'Out' => '锐', + 'Percentage' => '橡铞屙螓', + 'Ported to OpenVMS Alpha by' => '冷囡蜩痤忄眍 潆 OpenVMS Alpha', + 'Ported to WindowsNT by' => '冷囡蜩痤忄眍 潆 WindowsNT', + 'and' => '', + '^GREEN' => '桥伺哇', + 'BLUE' => '讶腿', + 'DARK GREEN' => '遗掏吻潘磐凵', + 'MAGENTA' => '匀嗡乓温凵', + 'AMBER' => '咄依型凵' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -4536,25 +4536,25 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => ' 飨铀遗优呜', 'Sun' => '饔', - 'Monday' => ' 鹣闻呐特紊', 'Mon' => '鹞', - 'Tuesday' => ' 髟弦紊', 'Tue' => '髟', - 'Wednesday' => ' 笠拍', 'Wed' => '笠', - 'Thursday' => ' 宰乓', 'Thu' => '', - 'Friday' => ' 鹧晕擅', 'Fri' => '鹪', - 'Saturday' => ' 笳侣显', 'Sat' => '舐' + 'Sunday' => ' 骂耜疱皴睃', 'Sun' => '埋', + 'Monday' => ' 项礤溴朦龛', 'Mon' => '享', + 'Tuesday' => ' 买铕龛', 'Tue' => '买', + 'Wednesday' => ' 佯邃', 'Wed' => '佯', + 'Thursday' => ' 族蜮屦', 'Thu' => '昨', + 'Friday' => ' 蝽桷', 'Fri' => '向', + 'Saturday' => ' 洋後铗', 'Sat' => '厌' ); %month = ( - 'January' => '裎琢已', 'February' => '媾滓撂' , 'March' => '砹以', - 'Jan' => '裎', 'Feb' => '媾', 'Mar' => '砹', - 'April' => '嵝遗萄', 'May' => '砹', 'June' => '槔窝', - 'Apr' => '嵝', 'May' => '砹', 'Jun' => '槔', - 'July' => '槔萄', 'August' => '嶙钦釉', 'September' => '笈卧崖已', - 'Jul' => '槔', 'Aug' => '嶙', 'Sep' => '笈', - 'October' => '锼匝乱', 'November' => '钕崖已', 'December' => '渑肆乱', - 'Oct' => '锼', 'Nov' => '钕', 'Dec' => '渑' + 'January' => '唔忄', 'February' => '藻怵嚯' , 'March' => '锑痱', + 'Jan' => '唔', 'Feb' => '藻', 'Mar' => '锑', + 'April' => '里疱', 'May' => '锑', 'June' => '叁', + 'Apr' => '里', 'May' => '锑', 'Jun' => '叁', + 'July' => '叁', 'August' => '棱泱耱', 'September' => '彦眚狃', + 'Jul' => '叁', 'Aug' => '棱', 'Sep' => '彦', + 'October' => '侮狃', 'November' => '皖狃', 'December' => '腻赅狃', + 'Oct' => '侮', 'Nov' => '皖', 'Dec' => '腻' ); @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); @@ -4563,7 +4563,7 @@ foreach $i (keys %translations) if($foo[3]=~(/(.*)at(.*)/)) { @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; + $foo[3]=$quux[0].". ".$quux[1]; }; return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; }; @@ -5213,116 +5213,6 @@ foreach $i (keys %translations) } -# Ukrainian1251 - windowze encoding - -sub ukrainian1251 -{ - my $string = shift; -return "" unless defined $string; - my(%translations,%month,%wday); - - my($i,$j); - my(@dollar,@quux,@foo); - - %translations = - ( - 'iso-8859-1' => 'windows-1251', - 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯栝 怩充龛 蝠圄酬 玎 5 踱桦桧', - 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯栝 忤醭漤栝 蝠圄酬 玎 5 踱桦桧', - 'the device' => '镳桉蝠抽', - 'The statistics were last updated(.*)' => '务蜞眄 铐钼脲眄 耱囹桉蜩觇: $1', - ' Average\)' => ')', - 'Average' => '彦疱漤抽', - 'Max' => '锑犟桁嚯栝', - 'Current' => '项蝾黜栝', - 'version' => '忮瘃', - '`Daily\' Graph \((.*) Minute' => '腻眄栝 蝠圄酬 ( 皴疱漤祗 玎 $1 踱桦桧', - '`Weekly\' Graph \(30 Minute' => '诣骓邂栝 蝠圄酬 ( 皴疱漤祗 玎 30 踱桦桧' , - '`Monthly\' Graph \(2 Hour' => '坛黜栝 蝠圄酬 ( 皴疱漤祗 玎 溻i 泐滂龛', - '`Yearly\' Graph \(1 Day' => '谐黜栝 蝠圄酬 ( 皴疱漤祗 玎 钿桧 溴睃', - 'Incoming Traffic in (\S+) per Second' => '迈充龛 蝠圄酬 $1 玎 皴牦礓', - 'Outgoing Traffic in (\S+) per Second' => '妈醭漤栝 蝠圄酬 $1 玎 皴牦礓', - 'at which time (.*) had been up for(.*)' => '$1 涑: $2', - '([kMG]?)([bB])/s' => '$1$1/皴', - '([kMG]?)([bB])/min' => '$1$2/踱', - '([kMG]?)([bB])/h' => '$1$2/泐', - '([bB])/s' => '$1/皴', - '([bB])/min' => '$1/踱', - '([bB])/h' => '$1/泐', - 'Bits' => '岢蜞', - 'Bytes' => '徉轵圊', - 'In' => '怩充', - 'Out' => '忤醭', - 'Percentage' => '鲁漶铗铌', - 'Ported to OpenVMS Alpha by' => '项痱钼囗 磬 OpenVMS Alpha', - 'Ported to WindowsNT by' => '项痱钼囗 磬 WindowsNT', - 'and' => '蜞', - 'RED' => '着新瓮壬', - '^GREEN' => '桥伺腿', - 'BLUE' => '讶筒', - 'DARK GREEN' => '遗掏吻潘磐壬', - 'MAGENTA' => '圆嗡乓温壬', - 'AMBER' => '劣胸胰臀氯', - ); - -# maybe expansions with replacement of whitespace would be more appropriate - -foreach $i (keys %translations) -{ - my $trans = $translations{$i}; - $trans =~ s/\|/\|/; - return $string if eval " \$string =~ s|\${i}|${trans}| "; -}; - -%wday = - ( - 'Sunday' => ' 湾涑', 'Sun' => '弯', - 'Monday' => ' 项礤涑腩', 'Mon' => '享', - 'Tuesday' => ' 鲁怛铕铌', 'Tue' => '买', - 'Wednesday' => ' 彦疱溧', 'Wed' => '佯', - 'Thursday' => ' 族蜮屦', 'Thu' => '昨', - 'Friday' => ' 蟎'蝽桷', 'Fri' => '向', - 'Saturday' => ' 洋犷蜞', 'Sat' => '厌' - ); - -%month = - ( - 'January' => '殉黜', 'February' => '塔蝾泐' , 'March' => '铃疱珥', - 'Jan' => '殉', 'Feb' => '塔', 'Mar' => '铃', - 'April' => '殊瞅', 'May' => '茵噔', 'June' => '族疴', - 'Apr' => '殊', 'May' => '茵', 'Jun' => '族', - 'July' => '髓镯', 'August' => '彦痫', 'September' => '洛疱耥', - 'Jul' => '髓', 'Aug' => '彦', 'Sep' => '洛', - 'October' => '祁怛', 'November' => '髓耱铒噤', 'December' => '灭箐', - 'Oct' => '祁', 'Nov' => '髓', 'Dec' => '灭' - ); - - @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); - if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} ) - { - if($foo[3]=~(/(.*)at(.*)/)) - { - @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; - }; - return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; - }; - -# -# handle two different time/date formats: -# return "$wday, $mday $month ".($year+1900)." at $hour:$min"; -# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; -# - -# handle nontranslated strings which ought to be translated -# print STDERR "$_\n" or print DEBUG "not translated $_"; -# but then again we might not want/need to translate all strings - - return $string; - -}; - - # Ukrainian sub ukrainian @@ -5431,4 +5321,114 @@ foreach $i (keys %translations) return $string; }; + + +# Ukrainian1251 - windowze encoding + +sub ukrainian1251 +{ + my $string = shift; +return "" unless defined $string; + my(%translations,%month,%wday); + + my($i,$j); + my(@dollar,@quux,@foo); + + %translations = + ( + 'iso-8859-1' => 'windows-1251', + 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯栝 怩充龛 蝠圄酬 玎 5 踱桦桧', + 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯栝 忤醭漤栝 蝠圄酬 玎 5 踱桦桧', + 'the device' => '镳桉蝠抽', + 'The statistics were last updated(.*)' => '务蜞眄 铐钼脲眄 耱囹桉蜩觇: $1', + ' Average\)' => ')', + 'Average' => '彦疱漤抽', + 'Max' => '锑犟桁嚯栝', + 'Current' => '项蝾黜栝', + 'version' => '忮瘃', + '`Daily\' Graph \((.*) Minute' => '腻眄栝 蝠圄酬 ( 皴疱漤祗 玎 $1 踱桦桧', + '`Weekly\' Graph \(30 Minute' => '诣骓邂栝 蝠圄酬 ( 皴疱漤祗 玎 30 踱桦桧' , + '`Monthly\' Graph \(2 Hour' => '坛黜栝 蝠圄酬 ( 皴疱漤祗 玎 溻i 泐滂龛', + '`Yearly\' Graph \(1 Day' => '谐黜栝 蝠圄酬 ( 皴疱漤祗 玎 钿桧 溴睃', + 'Incoming Traffic in (\S+) per Second' => '迈充龛 蝠圄酬 $1 玎 皴牦礓', + 'Outgoing Traffic in (\S+) per Second' => '妈醭漤栝 蝠圄酬 $1 玎 皴牦礓', + 'at which time (.*) had been up for(.*)' => '$1 涑: $2', + '([kMG]?)([bB])/s' => '$1$1/皴', + '([kMG]?)([bB])/min' => '$1$2/踱', + '([kMG]?)([bB])/h' => '$1$2/泐', + '([bB])/s' => '$1/皴', + '([bB])/min' => '$1/踱', + '([bB])/h' => '$1/泐', + 'Bits' => '岢蜞', + 'Bytes' => '徉轵圊', + 'In' => '怩充', + 'Out' => '忤醭', + 'Percentage' => '鲁漶铗铌', + 'Ported to OpenVMS Alpha by' => '项痱钼囗 磬 OpenVMS Alpha', + 'Ported to WindowsNT by' => '项痱钼囗 磬 WindowsNT', + 'and' => '蜞', + 'RED' => '着新瓮壬', + '^GREEN' => '桥伺腿', + 'BLUE' => '讶筒', + 'DARK GREEN' => '遗掏吻潘磐壬', + 'MAGENTA' => '圆嗡乓温壬', + 'AMBER' => '劣胸胰臀氯', + ); + +# maybe expansions with replacement of whitespace would be more appropriate + +foreach $i (keys %translations) +{ + my $trans = $translations{$i}; + $trans =~ s/\|/\|/; + return $string if eval " \$string =~ s|\${i}|${trans}| "; +}; + +%wday = + ( + 'Sunday' => ' 湾涑', 'Sun' => '弯', + 'Monday' => ' 项礤涑腩', 'Mon' => '享', + 'Tuesday' => ' 鲁怛铕铌', 'Tue' => '买', + 'Wednesday' => ' 彦疱溧', 'Wed' => '佯', + 'Thursday' => ' 族蜮屦', 'Thu' => '昨', + 'Friday' => ' 蟎'蝽桷', 'Fri' => '向', + 'Saturday' => ' 洋犷蜞', 'Sat' => '厌' + ); + +%month = + ( + 'January' => '殉黜', 'February' => '塔蝾泐' , 'March' => '铃疱珥', + 'Jan' => '殉', 'Feb' => '塔', 'Mar' => '铃', + 'April' => '殊瞅', 'May' => '茵噔', 'June' => '族疴', + 'Apr' => '殊', 'May' => '茵', 'Jun' => '族', + 'July' => '髓镯', 'August' => '彦痫', 'September' => '洛疱耥', + 'Jul' => '髓', 'Aug' => '彦', 'Sep' => '洛', + 'October' => '祁怛', 'November' => '髓耱铒噤', 'December' => '灭箐', + 'Oct' => '祁', 'Nov' => '髓', 'Dec' => '灭' + ); + + @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); + if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} ) + { + if($foo[3]=~(/(.*)at(.*)/)) + { + @quux=split(/at/,$foo[3]); + $foo[3]=$quux[0].". ".$quux[1]; + }; + return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; + }; + +# +# handle two different time/date formats: +# return "$wday, $mday $month ".($year+1900)." at $hour:$min"; +# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; +# + +# handle nontranslated strings which ought to be translated +# print STDERR "$_\n" or print DEBUG "not translated $_"; +# but then again we might not want/need to translate all strings + + return $string; + +}; diff --git a/src/src/rateup.c b/src/src/rateup.c index 38a9b4d..519c422 100644 --- a/src/src/rateup.c +++ b/src/src/rateup.c @@ -1,5 +1,5 @@ /* - MRTG 2.17.8 -- Rateup + MRTG 2.17.9 -- Rateup ********************* Rateup is a fast add-on to the great MRTG Traffic monitor. It makes @@ -37,8 +37,9 @@ #ifndef NETWARE #include "../config.h" #endif -#include #endif +#include +#include #include #include #include @@ -83,7 +84,7 @@ #include #include -char *VERSION = "2.17.8"; +char *VERSION = "2.17.9"; char *program, *router, *routerpath; int histvalid; diff --git a/src/translate/locales_mrtg.pm b/src/translate/locales_mrtg.pm index 9419179..f9ee2ac 100644 --- a/src/translate/locales_mrtg.pm +++ b/src/translate/locales_mrtg.pm @@ -61,10 +61,10 @@ ### and St茅phane Marzloff ### Galician/Galego ### => David Garabana Barro -### Chinese/中文简体 -### => Peter Wong 子荣 ### Chinese/简体汉字 ### => Zhanghui 张辉 +### Chinese/中文简体 +### => Peter Wong 子荣 ### German/Deutsch ### => Ilja Pavkovic ### Greek/Ellinika @@ -98,10 +98,10 @@ ### => Diogo Gomes ### Rom鉵/Romanian ### => J髗sef Szil醙yi -### Russian1251/畜耨觇1251 -### => 离尻襦礓 绣濑 ### Russian/蛘佑松 ### => 渫稍疑 笊琢夼嗡 +### Russian1251/畜耨觇1251 +### => 离尻襦礓 绣濑 ### Serbian/Srpski ### => Ratko Bucic ### Slovak/Slovensky @@ -114,10 +114,10 @@ ### => Clas Mayer ### Turkish/T黵k鏴 ### => 謟g黵 C. Demir -### Ukrainian/雨疣宽顸赅 -### => Olexander Kunytsa ### Ukrainian/跛伊迂肆 ### => 笈仪κ 缯挺桅滔咨 +### Ukrainian/雨疣宽顸赅 +### => Olexander Kunytsa ### ### Contributions and fixes by: ### @@ -163,8 +163,8 @@ $VERSION = '0.07'; &german &french &galician - &gb2312 &gb + &gb2312 &german &greek &hungarian @@ -180,16 +180,16 @@ $VERSION = '0.07'; &polish &portuguese &romanian - &russian1251 &russian + &russian1251 &serbian &slovak &slovenian &spanish &swedish &turkish - &ukrainian1251 &ukrainian + &ukrainian1251 ); %lang2tran::LOCALE= @@ -228,10 +228,10 @@ $VERSION = '0.07'; 'francais' => \&french, 'galician' => \&galician, 'galego' => \&galician, - 'gb2312' => \&gb2312, - '中文简体' => \&gb2312, 'gb' => \&gb, '简体汉字' => \&gb, + 'gb2312' => \&gb2312, + '中文简体' => \&gb2312, 'german' => \&german, 'german' => \&german, 'greek' => \&greek, @@ -260,10 +260,10 @@ $VERSION = '0.07'; 'portuguese' => \&portuguese, 'romanian' => \&romanian, 'rom鉵' => \&romanian, - 'russian1251' => \&russian1251, - '畜耨觇1251' => \&russian1251, 'russian' => \&russian, '蛘佑松' => \&russian, + 'russian1251' => \&russian1251, + '畜耨觇1251' => \&russian1251, 'serbian' => \&serbian, 'slovak' => \&slovak, 'slovenian' => \&slovenian, @@ -273,10 +273,10 @@ $VERSION = '0.07'; 'svenska' => \&swedish, 'turkish' => \&turkish, 'turkce' => \&turkish, - 'ukrainian1251' => \&ukrainian1251, - '雨疣宽顸赅1251' => \&ukrainian1251, 'ukrainian' => \&ukrainian, '跛伊迂肆' => \&ukrainian, + 'ukrainian1251' => \&ukrainian1251, + '雨疣宽顸赅1251' => \&ukrainian1251, ); %credits::LOCALE= @@ -381,16 +381,16 @@ $VERSION = '0.07'; "Traducido ao galego por David Garabana Barro <dgaraban\@arrakis.es>", -# Chinese/中文简体 - 'gb2312' => - "中文化作者 - Peter Wong - &webmaster\@tcpip.com.cn>", # Chinese/简体汉字 'gb' => "いゅて Hui Zhang <zhanghui\@asiainfo.com>", +# Chinese/中文简体 + 'gb2312' => + "中文化作者 + Peter Wong + &webmaster\@tcpip.com.cn>", # German/deutsch 'german' => "Vorbereitet für die Lokalisation von @@ -470,16 +470,16 @@ $VERSION = '0.07'; "Tradus de J髗sef Szil醙yi <jozsi\@maxiq.ro>", -# Russian1251/畜耨觇1251 - 'russian1251' => - "襄疱忸 磬 痼耨觇 琨 (觐滂痤怅 1251): - 离尻襦礓 绣濑 - <aredyuk\@irmcity.com>", # Russian/蛘佑松 'russian' => "鹋遗紫 瘟 艺佑松 掩偎: 渫稍疑 笊琢夼嗡 <mitya\@cavia.pp.ru>", +# Russian1251/畜耨觇1251 + 'russian1251' => + "襄疱忸 磬 痼耨觇 琨 (觐滂痤怅 1251): + 离尻襦礓 绣濑 + <aredyuk\@irmcity.com>", # Serbian/Srpski 'serbian' => "Ported to Serbian by / Srpski prevod uradio: @@ -509,16 +509,16 @@ $VERSION = '0.07'; 'turkish' => "T黵k鏴le⺶iren 謟g黵 C. Demir", -# Ukrainian1251/雨疣宽顸赅1251 - 'ukrainian1251' => - "襄疱觌噤 箨疣宽顸觐 (cp1251): - 坞尻襦礓 鼠龛 - <xakep\@snark.ukma.kiev.ua>", # Ukrainian/跛伊迂肆 'ukrainian' => "鹋遗颂聊 瘟 账伊迂苏 拖渍: 笈仪κ 缯挺桅滔咨 <gray\@arte-fact.net>", +# Ukrainian1251/雨疣宽顸赅1251 + 'ukrainian1251' => + "襄疱觌噤 箨疣宽顸觐 (cp1251): + 坞尻襦礓 鼠龛 + <xakep\@snark.ukma.kiev.ua>", ); $credits::LOCALE{'斜械谢邪褉褍褋泻邪褟'}=$credits::LOCALE{'belarusian'}; @@ -538,8 +538,8 @@ $credits::LOCALE{'euc-jp'}=$credits::LOCALE{'eucjp'}; $credits::LOCALE{'finnish'}=$credits::LOCALE{'finnish'}; $credits::LOCALE{'francais'}=$credits::LOCALE{'french'}; $credits::LOCALE{'galego'}=$credits::LOCALE{'galician'}; -$credits::LOCALE{'中文简体'}=$credits::LOCALE{'gb2312'}; $credits::LOCALE{'简体汉字'}=$credits::LOCALE{'gb'}; +$credits::LOCALE{'中文简体'}=$credits::LOCALE{'gb2312'}; $credits::LOCALE{'deutsch'}=$credits::LOCALE{'german'}; $credits::LOCALE{'ellinika'}=$credits::LOCALE{'greek'}; $credits::LOCALE{'magyar'}=$credits::LOCALE{'hungarian'}; @@ -555,16 +555,16 @@ $credits::LOCALE{'norsk'}=$credits::LOCALE{'norwegian'}; $credits::LOCALE{'polski'}=$credits::LOCALE{'polish'}; $credits::LOCALE{'portuguese'}=$credits::LOCALE{'portuguese'}; $credits::LOCALE{'rom鉵'}=$credits::LOCALE{'romanian'}; -$credits::LOCALE{'畜耨觇1251'}=$credits::LOCALE{'russian1251'}; $credits::LOCALE{'蛘佑松'}=$credits::LOCALE{'russian'}; +$credits::LOCALE{'畜耨觇1251'}=$credits::LOCALE{'russian1251'}; $credits::LOCALE{'serbian'}=$credits::LOCALE{'serbian'}; $credits::LOCALE{'slovak'}=$credits::LOCALE{'slovak'}; $credits::LOCALE{'slovenian'}=$credits::LOCALE{'slovenian'}; $credits::LOCALE{'espanol'}=$credits::LOCALE{'spanish'}; $credits::LOCALE{'svenska'}=$credits::LOCALE{'swedish'}; $credits::LOCALE{'turkce'}=$credits::LOCALE{'turkish'}; -$credits::LOCALE{'雨疣宽顸赅1251'}=$credits::LOCALE{'ukrainian1251'}; $credits::LOCALE{'跛伊迂肆'}=$credits::LOCALE{'ukrainian'}; +$credits::LOCALE{'雨疣宽顸赅1251'}=$credits::LOCALE{'ukrainian1251'}; # English - default sub english @@ -2458,9 +2458,9 @@ foreach $i (keys %translations) return $string; }; -# Chinese gb2312 Code +# Chinese gb Code -sub gb2312 +sub gb { my $string = shift; return "" unless defined $string; @@ -2475,39 +2475,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'gb2312', - 'Maximal 5 Minute Incoming Traffic' => '5分钟最大流入量', - 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大流出量', - 'the device' => '装置', - 'The statistics were last updated(.*)' => '上次统计更新时间: $1', - ' Average\)' => ' 平均)', + 'iso-8859-1' => 'gb', + 'Maximal 5 Minute Incoming Traffic' => '5分钟最大的流量', + 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大的流出流量', + 'the device' => '当前设备', + 'The statistics were last updated(.*)' => '统计信息更新于: $1', + ' Average\)' => '平均)', 'Average' => '平均', 'Max' => '最大', - 'Current' => '目前', + 'Current' => '当前', 'version' => '版本', - '`Daily\' Graph \((.*) Minute' => '每日 图表 ($1 分钟', - '`Weekly\' Graph \(30 Minute' => '每周 图表 (30 分钟' , - '`Monthly\' Graph \(2 Hour' => '每月 图表 (2 小时', - '`Yearly\' Graph \(1 Day' => '每年 图表 (1 天', - 'Incoming Traffic in (\S+) per Second' => '每秒流入量 (单位 $1)', - 'Outgoing Traffic in (\S+) per Second' => '每秒流出量 (单位 $1)', - 'at which time (.*) had been up for(.*)' => '设备名称 $1,已运作时间(UPTIME): $2', - '([kMG]?)([bB])/s' => '\$1\$2/秒', - '([kMG]?)([bB])/min' => '\$1\$2/分', - '([kMG]?)([bB])/h' => '$1$2/时', + '`Daily\' Graph \((.*) Minute' => '日分析图($1分钟', + '`Weekly\' Graph \(30 Minute' => '周分析图(30分钟' , + '`Monthly\' Graph \(2 Hour' => '月分析图(2小时', + '`Yearly\' Graph \(1 Day' => '年分析图(1天', + 'Incoming Traffic in (\S+) per Second' => '每秒的流入流量(单位$1)', + 'Outgoing Traffic in (\S+) per Second' => '每秒的流出流量(单位$1)', + 'at which time (.*) had been up for(.*)' => '其时 $1已经更新(UPTIME): $2', + '([kMG]?)([bB])/s' => '$1$2/s', + '([kMG]?)([bB])/min' => '$1$2/m', + '([kMG]?)([bB])/h' => '$1$2/h', # 'Bits' => 'Bits', # 'Bytes' => 'Bytes' 'In' => '流入', 'Out' => '流出', 'Percentage' => '百分比', - 'Ported to OpenVMS Alpha by' => '移植到 OpenVM Alpha 作者', - 'Ported to WindowsNT by' => '移植到 WindowsNT 作者', - 'and' => '及', + 'Ported to OpenVMS Alpha by' => 'OpenVMS的端口', + 'Ported to WindowsNT by' => 'WindowsNT的端口', + 'and' => '与', '^GREEN' => '绿色', - 'BLUE' => '蓝色', - 'DARK GREEN' => '墨绿色', - 'MAGENTA' => '紫色', - 'AMBER' => '琥珀色' + 'BLUE' => '兰色', + 'DARK GREEN' => '暗绿', + 'MAGENTA' => '褐色', + 'AMBER' => '紫色' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -2521,26 +2521,26 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => '星期天', 'Sun' => '日', - 'Monday' => '星期一', 'Mon' => '一', - 'Tuesday' => '星期二', 'Tue' => '二', - 'Wednesday' => '星期三', 'Wed' => '三', - 'Thursday' => '星期四', 'Thu' => '四', - 'Friday' => '星期五', 'Fri' => '五', - 'Saturday' => '星期六', 'Sat' => '六' + 'Sunday' => '周日', 'Sun' => '周日', + 'Monday' => '周一', 'Mon' => '周一', + 'Tuesday' => '周二', 'Tue' => '周二', + 'Wednesday' => '周三', 'Wed' => '周三', + 'Thursday' => '周四', 'Thu' => '周四', + 'Friday' => '周五', 'Fri' => '周五', + 'Saturday' => '周六', 'Sat' => '周六' ); %month = ( - 'January' => '一月', 'February' => '二月', 'March' => '三月', - 'Jan' => '一', 'Feb' => '二', 'Mar' => '三', - 'April' => '四月', 'May' => '五月', 'June' => '六月', - 'Apr' => '四', 'May' => '五', 'Jun' => '六', - 'July' => '七月', 'August' => '八月', 'September' => '九月', - 'Jul' => '七', 'Aug' => '八', 'Sep' => '九', - 'October' => '十月', 'November' => '十一月', 'December' => '十二月', - 'Oct' => '十', 'Nov' => '十一', 'Dec' => '十二' + 'January' => '1月', 'February' => '2月', 'March' => '3月', + 'Jan' => '1月', 'Feb' => '2月', 'Mar' => '3月', + 'April' => '4月', 'May' => '5月', 'June' => '6月', + 'Apr' => '4月', 'May' => '5月', 'Jun' => '6月', + 'July' => '7月', 'August' => '8月', 'September' => '9月', + 'Jul' => '7月', 'Aug' => '8月', 'Sep' => '9月', + 'October' => '10月', 'November' => '11月', 'December' => '12月', + 'Oct' => '10月', 'Nov' => '11月', 'Dec' => '12月' ); @@ -2554,7 +2554,7 @@ foreach $i (keys %translations) $foo[3]=$quux[0]; $foo[4]=$quux[1]; }; - return "$foo[3] $month{$foo[2]} $foo[1] 日, $wday{$foo[0]}, $foo[4]"; + return "$foo[3]年 $month{$foo[2]} $foo[1]日, $wday{$foo[0]}, $foo[4]"; }; # @@ -2570,9 +2570,9 @@ foreach $i (keys %translations) return $string; }; -# Chinese gb Code +# Chinese gb2312 Code -sub gb +sub gb2312 { my $string = shift; return "" unless defined $string; @@ -2587,39 +2587,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'gb', - 'Maximal 5 Minute Incoming Traffic' => '5分钟最大的流量', - 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大的流出流量', - 'the device' => '当前设备', - 'The statistics were last updated(.*)' => '统计信息更新于: $1', - ' Average\)' => '平均)', + 'iso-8859-1' => 'gb2312', + 'Maximal 5 Minute Incoming Traffic' => '5分钟最大流入量', + 'Maximal 5 Minute Outgoing Traffic' => '5分钟最大流出量', + 'the device' => '装置', + 'The statistics were last updated(.*)' => '上次统计更新时间: $1', + ' Average\)' => ' 平均)', 'Average' => '平均', 'Max' => '最大', - 'Current' => '当前', + 'Current' => '目前', 'version' => '版本', - '`Daily\' Graph \((.*) Minute' => '日分析图($1分钟', - '`Weekly\' Graph \(30 Minute' => '周分析图(30分钟' , - '`Monthly\' Graph \(2 Hour' => '月分析图(2小时', - '`Yearly\' Graph \(1 Day' => '年分析图(1天', - 'Incoming Traffic in (\S+) per Second' => '每秒的流入流量(单位$1)', - 'Outgoing Traffic in (\S+) per Second' => '每秒的流出流量(单位$1)', - 'at which time (.*) had been up for(.*)' => '其时 $1已经更新(UPTIME): $2', - '([kMG]?)([bB])/s' => '$1$2/s', - '([kMG]?)([bB])/min' => '$1$2/m', - '([kMG]?)([bB])/h' => '$1$2/h', + '`Daily\' Graph \((.*) Minute' => '每日 图表 ($1 分钟', + '`Weekly\' Graph \(30 Minute' => '每周 图表 (30 分钟' , + '`Monthly\' Graph \(2 Hour' => '每月 图表 (2 小时', + '`Yearly\' Graph \(1 Day' => '每年 图表 (1 天', + 'Incoming Traffic in (\S+) per Second' => '每秒流入量 (单位 $1)', + 'Outgoing Traffic in (\S+) per Second' => '每秒流出量 (单位 $1)', + 'at which time (.*) had been up for(.*)' => '设备名称 $1,已运作时间(UPTIME): $2', + '([kMG]?)([bB])/s' => '\$1\$2/秒', + '([kMG]?)([bB])/min' => '\$1\$2/分', + '([kMG]?)([bB])/h' => '$1$2/时', # 'Bits' => 'Bits', # 'Bytes' => 'Bytes' 'In' => '流入', 'Out' => '流出', 'Percentage' => '百分比', - 'Ported to OpenVMS Alpha by' => 'OpenVMS的端口', - 'Ported to WindowsNT by' => 'WindowsNT的端口', - 'and' => '与', + 'Ported to OpenVMS Alpha by' => '移植到 OpenVM Alpha 作者', + 'Ported to WindowsNT by' => '移植到 WindowsNT 作者', + 'and' => '及', '^GREEN' => '绿色', - 'BLUE' => '兰色', - 'DARK GREEN' => '暗绿', - 'MAGENTA' => '褐色', - 'AMBER' => '紫色' + 'BLUE' => '蓝色', + 'DARK GREEN' => '墨绿色', + 'MAGENTA' => '紫色', + 'AMBER' => '琥珀色' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -2633,26 +2633,26 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => '周日', 'Sun' => '周日', - 'Monday' => '周一', 'Mon' => '周一', - 'Tuesday' => '周二', 'Tue' => '周二', - 'Wednesday' => '周三', 'Wed' => '周三', - 'Thursday' => '周四', 'Thu' => '周四', - 'Friday' => '周五', 'Fri' => '周五', - 'Saturday' => '周六', 'Sat' => '周六' + 'Sunday' => '星期天', 'Sun' => '日', + 'Monday' => '星期一', 'Mon' => '一', + 'Tuesday' => '星期二', 'Tue' => '二', + 'Wednesday' => '星期三', 'Wed' => '三', + 'Thursday' => '星期四', 'Thu' => '四', + 'Friday' => '星期五', 'Fri' => '五', + 'Saturday' => '星期六', 'Sat' => '六' ); %month = ( - 'January' => '1月', 'February' => '2月', 'March' => '3月', - 'Jan' => '1月', 'Feb' => '2月', 'Mar' => '3月', - 'April' => '4月', 'May' => '5月', 'June' => '6月', - 'Apr' => '4月', 'May' => '5月', 'Jun' => '6月', - 'July' => '7月', 'August' => '8月', 'September' => '9月', - 'Jul' => '7月', 'Aug' => '8月', 'Sep' => '9月', - 'October' => '10月', 'November' => '11月', 'December' => '12月', - 'Oct' => '10月', 'Nov' => '11月', 'Dec' => '12月' + 'January' => '一月', 'February' => '二月', 'March' => '三月', + 'Jan' => '一', 'Feb' => '二', 'Mar' => '三', + 'April' => '四月', 'May' => '五月', 'June' => '六月', + 'Apr' => '四', 'May' => '五', 'Jun' => '六', + 'July' => '七月', 'August' => '八月', 'September' => '九月', + 'Jul' => '七', 'Aug' => '八', 'Sep' => '九', + 'October' => '十月', 'November' => '十一月', 'December' => '十二月', + 'Oct' => '十', 'Nov' => '十一', 'Dec' => '十二' ); @@ -2666,7 +2666,7 @@ foreach $i (keys %translations) $foo[3]=$quux[0]; $foo[4]=$quux[1]; }; - return "$foo[3]年 $month{$foo[2]} $foo[1]日, $wday{$foo[0]}, $foo[4]"; + return "$foo[3] $month{$foo[2]} $foo[1] 日, $wday{$foo[0]}, $foo[4]"; }; # @@ -4361,9 +4361,11 @@ foreach $i (keys %translations) return $string; }; -# Russian1251 Code -sub russian1251 + +# Russian + +sub russian { my $string = shift; return "" unless defined $string; @@ -4378,41 +4380,39 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'windows-1251', - 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯 怩钿 蝠圄桕 玎 5 扈眢', - 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯 桉躅 蝠圄桕 玎 5 扈眢', - 'the device' => '篑蝠铋耱忸', - 'The statistics were last updated(.*)' => '吗屐 镱耠邃礤泐 钺眍怆屙: $1', + 'iso-8859-1' => 'koi8-r', + 'Maximal 5 Minute Incoming Traffic' => '砹擞赏撂匚偈 兹夏演墒 砸疗伤 诹 5 蜕握', + 'Maximal 5 Minute Outgoing Traffic' => '砹擞赏撂匚偈 捎认难萆 砸疗伤 诹 5 蜕握', + 'the device' => '沼砸鲜釉紫', + 'The statistics were last updated(.*)' => '鹣犹拍闻 下蜗滋盼膳 釉猎捎陨松: $1', ' Average\)' => ')', - 'Average' => ' 耩邃礤', - 'Max' => '锑犟桁嚯', - 'Current' => '彦轺囫', - 'version' => '忮瘃', - '`Daily\' Graph \((.*) Minute' => '洋蝾黜 沭圄桕 (耩邃礤 玎 $1 扈眢', - '`Weekly\' Graph \(30 Minute' => '湾溴朦睇 沭圄桕 (耩邃礤 玎 30 扈眢' , - '`Monthly\' Graph \(2 Hour' => '体黜 沭圄桕 (耩邃礤 玎 2 鬣襦', - '`Yearly\' Graph \(1 Day' => '妙漕忸 沭圄桕 (耩邃礤 玎 1 溴睃', - 'Incoming Traffic in (\S+) per Second' => '迈钿 蝠圄桕 $1 皴牦礓', - 'Outgoing Traffic in (\S+) per Second' => '锐躅 蝠圄桕 $1 皴牦礓', - 'at which time (\S+) had been up for (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2.', - 'at which time (\S+) had been up for (\S+) day, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蜿, $3.', - 'at which time (\S+) had been up for (\S+) days, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蝾, $3.', - #'([kMG]?)([bB])/s' => '$1$1/皴', - #'([kMG]?)([bB])/min' => '$1$2/扈', - '([kMG]?)([bB])/h' => '$1$2/鬣', - 'Bits' => '徼蜞', - 'Bytes' => '徉轵圊', - 'In' => '迈', - 'Out' => '锐', - 'Percentage' => '橡铞屙螓', - 'Ported to OpenVMS Alpha by' => '冷囡蜩痤忄眍 潆 OpenVMS Alpha', - 'Ported to WindowsNT by' => '冷囡蜩痤忄眍 潆 WindowsNT', - 'and' => '', - '^GREEN' => '桥伺哇', - 'BLUE' => '讶腿', - 'DARK GREEN' => '遗掏吻潘磐凵', - 'MAGENTA' => '匀嗡乓温凵', - 'AMBER' => '咄依型凵' + 'Average' => '笠拍紊', + 'Max' => '砹擞.', + 'Current' => '襞苏萆', + 'version' => '着矣裳', + '`Daily\' Graph \((.*) Minute' => '笳韵尬偈 且疗伤 (右拍闻 诹 $1 蜕握', + '`Weekly\' Graph \(30 Minute' => '钆呐特钨 且疗伤 (右拍闻 诹 30 蜕握' , + '`Monthly\' Graph \(2 Hour' => '砼友尬偈 且疗伤 (右拍闻 诹 2 蘖恿', + '`Yearly\' Graph \(1 Day' => '缦南紫 且疗伤 (右拍闻 诹 1 呐呜', + 'Incoming Traffic in (\S+) per Second' => '魅夏演墒 砸疗伤 $1 优苏文', + 'Outgoing Traffic in (\S+) per Second' => '橛认难萆 砸疗伤 $1 优苏文', + 'at which time (.*) had been up for(.*)' => ' 茉 滓磐 $1 沦塘 姿汤夼瘟 $2', + #'([kMG]?)([bB])/s' => '$1$1/优', + #'([kMG]?)([bB])/min' => '$1$2/蜕', + '([kMG]?)([bB])/h' => '$1$2/蘖', + 'Bits' => '律粤', + 'Bytes' => '铝试寥', + 'In' => '魅', + 'Out' => '橛', + 'Percentage' => '鹨厦盼再', + 'Ported to OpenVMS Alpha by' => '崮列陨蚁琢蜗 奶 OpenVMS Alpha', + 'Ported to WindowsNT by' => '崮列陨蚁琢蜗 奶 WindowsNT', + 'and' => '', + '^GREEN' => '戾铢', + 'BLUE' => '箝铋', + 'DARK GREEN' => '翦眍嵇屐孱', + 'MAGENTA' => '骈镬弭秣', + 'AMBER' => '耦翎蝾' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -4426,25 +4426,25 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => ' 骂耜疱皴睃', 'Sun' => '埋', - 'Monday' => ' 项礤溴朦龛', 'Mon' => '享', - 'Tuesday' => ' 买铕龛', 'Tue' => '买', - 'Wednesday' => ' 佯邃', 'Wed' => '佯', - 'Thursday' => ' 族蜮屦', 'Thu' => '昨', - 'Friday' => ' 蝽桷', 'Fri' => '向', - 'Saturday' => ' 洋後铗', 'Sat' => '厌' + 'Sunday' => ' 飨铀遗优呜', 'Sun' => '饔', + 'Monday' => ' 鹣闻呐特紊', 'Mon' => '鹞', + 'Tuesday' => ' 髟弦紊', 'Tue' => '髟', + 'Wednesday' => ' 笠拍', 'Wed' => '笠', + 'Thursday' => ' 宰乓', 'Thu' => '', + 'Friday' => ' 鹧晕擅', 'Fri' => '鹪', + 'Saturday' => ' 笳侣显', 'Sat' => '舐' ); %month = ( - 'January' => '唔忄', 'February' => '藻怵嚯' , 'March' => '锑痱', - 'Jan' => '唔', 'Feb' => '藻', 'Mar' => '锑', - 'April' => '里疱', 'May' => '锑', 'June' => '叁', - 'Apr' => '里', 'May' => '锑', 'Jun' => '叁', - 'July' => '叁', 'August' => '棱泱耱', 'September' => '彦眚狃', - 'Jul' => '叁', 'Aug' => '棱', 'Sep' => '彦', - 'October' => '侮狃', 'November' => '皖狃', 'December' => '腻赅狃', - 'Oct' => '侮', 'Nov' => '皖', 'Dec' => '腻' + 'January' => '裎琢已', 'February' => '媾滓撂' , 'March' => '砹以', + 'Jan' => '裎', 'Feb' => '媾', 'Mar' => '砹', + 'April' => '嵝遗萄', 'May' => '砹', 'June' => '槔窝', + 'Apr' => '嵝', 'May' => '砹', 'Jun' => '槔', + 'July' => '槔萄', 'August' => '嶙钦釉', 'September' => '笈卧崖已', + 'Jul' => '槔', 'Aug' => '嶙', 'Sep' => '笈', + 'October' => '锼匝乱', 'November' => '钕崖已', 'December' => '渑肆乱', + 'Oct' => '锼', 'Nov' => '钕', 'Dec' => '渑' ); @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); @@ -4453,7 +4453,7 @@ foreach $i (keys %translations) if($foo[3]=~(/(.*)at(.*)/)) { @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; + $foo[3]=$quux[0].". ".$quux[1]; }; return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; }; @@ -4471,11 +4471,9 @@ foreach $i (keys %translations) return $string; }; +# Russian1251 Code - -# Russian - -sub russian +sub russian1251 { my $string = shift; return "" unless defined $string; @@ -4490,39 +4488,41 @@ return "" unless defined $string; %translations = ( - 'iso-8859-1' => 'koi8-r', - 'Maximal 5 Minute Incoming Traffic' => '砹擞赏撂匚偈 兹夏演墒 砸疗伤 诹 5 蜕握', - 'Maximal 5 Minute Outgoing Traffic' => '砹擞赏撂匚偈 捎认难萆 砸疗伤 诹 5 蜕握', - 'the device' => '沼砸鲜釉紫', - 'The statistics were last updated(.*)' => '鹣犹拍闻 下蜗滋盼膳 釉猎捎陨松: $1', + 'iso-8859-1' => 'windows-1251', + 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯 怩钿 蝠圄桕 玎 5 扈眢', + 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯 桉躅 蝠圄桕 玎 5 扈眢', + 'the device' => '篑蝠铋耱忸', + 'The statistics were last updated(.*)' => '吗屐 镱耠邃礤泐 钺眍怆屙: $1', ' Average\)' => ')', - 'Average' => '笠拍紊', - 'Max' => '砹擞.', - 'Current' => '襞苏萆', - 'version' => '着矣裳', - '`Daily\' Graph \((.*) Minute' => '笳韵尬偈 且疗伤 (右拍闻 诹 $1 蜕握', - '`Weekly\' Graph \(30 Minute' => '钆呐特钨 且疗伤 (右拍闻 诹 30 蜕握' , - '`Monthly\' Graph \(2 Hour' => '砼友尬偈 且疗伤 (右拍闻 诹 2 蘖恿', - '`Yearly\' Graph \(1 Day' => '缦南紫 且疗伤 (右拍闻 诹 1 呐呜', - 'Incoming Traffic in (\S+) per Second' => '魅夏演墒 砸疗伤 $1 优苏文', - 'Outgoing Traffic in (\S+) per Second' => '橛认难萆 砸疗伤 $1 优苏文', - 'at which time (.*) had been up for(.*)' => ' 茉 滓磐 $1 沦塘 姿汤夼瘟 $2', - #'([kMG]?)([bB])/s' => '$1$1/优', - #'([kMG]?)([bB])/min' => '$1$2/蜕', - '([kMG]?)([bB])/h' => '$1$2/蘖', - 'Bits' => '律粤', - 'Bytes' => '铝试寥', - 'In' => '魅', - 'Out' => '橛', - 'Percentage' => '鹨厦盼再', - 'Ported to OpenVMS Alpha by' => '崮列陨蚁琢蜗 奶 OpenVMS Alpha', - 'Ported to WindowsNT by' => '崮列陨蚁琢蜗 奶 WindowsNT', - 'and' => '', - '^GREEN' => '戾铢', - 'BLUE' => '箝铋', - 'DARK GREEN' => '翦眍嵇屐孱', - 'MAGENTA' => '骈镬弭秣', - 'AMBER' => '耦翎蝾' + 'Average' => ' 耩邃礤', + 'Max' => '锑犟桁嚯', + 'Current' => '彦轺囫', + 'version' => '忮瘃', + '`Daily\' Graph \((.*) Minute' => '洋蝾黜 沭圄桕 (耩邃礤 玎 $1 扈眢', + '`Weekly\' Graph \(30 Minute' => '湾溴朦睇 沭圄桕 (耩邃礤 玎 30 扈眢' , + '`Monthly\' Graph \(2 Hour' => '体黜 沭圄桕 (耩邃礤 玎 2 鬣襦', + '`Yearly\' Graph \(1 Day' => '妙漕忸 沭圄桕 (耩邃礤 玎 1 溴睃', + 'Incoming Traffic in (\S+) per Second' => '迈钿 蝠圄桕 $1 皴牦礓', + 'Outgoing Traffic in (\S+) per Second' => '锐躅 蝠圄桕 $1 皴牦礓', + 'at which time (\S+) had been up for (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2.', + 'at which time (\S+) had been up for (\S+) day, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蜿, $3.', + 'at which time (\S+) had been up for (\S+) days, (\S+)' => '怵屐 镱耠 桧桷栲腓玎鲨 篑蝠铋耱忄 $1: $2 耋蝾, $3.', + #'([kMG]?)([bB])/s' => '$1$1/皴', + #'([kMG]?)([bB])/min' => '$1$2/扈', + '([kMG]?)([bB])/h' => '$1$2/鬣', + 'Bits' => '徼蜞', + 'Bytes' => '徉轵圊', + 'In' => '迈', + 'Out' => '锐', + 'Percentage' => '橡铞屙螓', + 'Ported to OpenVMS Alpha by' => '冷囡蜩痤忄眍 潆 OpenVMS Alpha', + 'Ported to WindowsNT by' => '冷囡蜩痤忄眍 潆 WindowsNT', + 'and' => '', + '^GREEN' => '桥伺哇', + 'BLUE' => '讶腿', + 'DARK GREEN' => '遗掏吻潘磐凵', + 'MAGENTA' => '匀嗡乓温凵', + 'AMBER' => '咄依型凵' ); # maybe expansions with replacement of whitespace would be more appropriate @@ -4536,25 +4536,25 @@ foreach $i (keys %translations) %wday = ( - 'Sunday' => ' 飨铀遗优呜', 'Sun' => '饔', - 'Monday' => ' 鹣闻呐特紊', 'Mon' => '鹞', - 'Tuesday' => ' 髟弦紊', 'Tue' => '髟', - 'Wednesday' => ' 笠拍', 'Wed' => '笠', - 'Thursday' => ' 宰乓', 'Thu' => '', - 'Friday' => ' 鹧晕擅', 'Fri' => '鹪', - 'Saturday' => ' 笳侣显', 'Sat' => '舐' + 'Sunday' => ' 骂耜疱皴睃', 'Sun' => '埋', + 'Monday' => ' 项礤溴朦龛', 'Mon' => '享', + 'Tuesday' => ' 买铕龛', 'Tue' => '买', + 'Wednesday' => ' 佯邃', 'Wed' => '佯', + 'Thursday' => ' 族蜮屦', 'Thu' => '昨', + 'Friday' => ' 蝽桷', 'Fri' => '向', + 'Saturday' => ' 洋後铗', 'Sat' => '厌' ); %month = ( - 'January' => '裎琢已', 'February' => '媾滓撂' , 'March' => '砹以', - 'Jan' => '裎', 'Feb' => '媾', 'Mar' => '砹', - 'April' => '嵝遗萄', 'May' => '砹', 'June' => '槔窝', - 'Apr' => '嵝', 'May' => '砹', 'Jun' => '槔', - 'July' => '槔萄', 'August' => '嶙钦釉', 'September' => '笈卧崖已', - 'Jul' => '槔', 'Aug' => '嶙', 'Sep' => '笈', - 'October' => '锼匝乱', 'November' => '钕崖已', 'December' => '渑肆乱', - 'Oct' => '锼', 'Nov' => '钕', 'Dec' => '渑' + 'January' => '唔忄', 'February' => '藻怵嚯' , 'March' => '锑痱', + 'Jan' => '唔', 'Feb' => '藻', 'Mar' => '锑', + 'April' => '里疱', 'May' => '锑', 'June' => '叁', + 'Apr' => '里', 'May' => '锑', 'Jun' => '叁', + 'July' => '叁', 'August' => '棱泱耱', 'September' => '彦眚狃', + 'Jul' => '叁', 'Aug' => '棱', 'Sep' => '彦', + 'October' => '侮狃', 'November' => '皖狃', 'December' => '腻赅狃', + 'Oct' => '侮', 'Nov' => '皖', 'Dec' => '腻' ); @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); @@ -4563,7 +4563,7 @@ foreach $i (keys %translations) if($foo[3]=~(/(.*)at(.*)/)) { @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; + $foo[3]=$quux[0].". ".$quux[1]; }; return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; }; @@ -5213,116 +5213,6 @@ foreach $i (keys %translations) } -# Ukrainian1251 - windowze encoding - -sub ukrainian1251 -{ - my $string = shift; -return "" unless defined $string; - my(%translations,%month,%wday); - - my($i,$j); - my(@dollar,@quux,@foo); - - %translations = - ( - 'iso-8859-1' => 'windows-1251', - 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯栝 怩充龛 蝠圄酬 玎 5 踱桦桧', - 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯栝 忤醭漤栝 蝠圄酬 玎 5 踱桦桧', - 'the device' => '镳桉蝠抽', - 'The statistics were last updated(.*)' => '务蜞眄 铐钼脲眄 耱囹桉蜩觇: $1', - ' Average\)' => ')', - 'Average' => '彦疱漤抽', - 'Max' => '锑犟桁嚯栝', - 'Current' => '项蝾黜栝', - 'version' => '忮瘃', - '`Daily\' Graph \((.*) Minute' => '腻眄栝 蝠圄酬 ( 皴疱漤祗 玎 $1 踱桦桧', - '`Weekly\' Graph \(30 Minute' => '诣骓邂栝 蝠圄酬 ( 皴疱漤祗 玎 30 踱桦桧' , - '`Monthly\' Graph \(2 Hour' => '坛黜栝 蝠圄酬 ( 皴疱漤祗 玎 溻i 泐滂龛', - '`Yearly\' Graph \(1 Day' => '谐黜栝 蝠圄酬 ( 皴疱漤祗 玎 钿桧 溴睃', - 'Incoming Traffic in (\S+) per Second' => '迈充龛 蝠圄酬 $1 玎 皴牦礓', - 'Outgoing Traffic in (\S+) per Second' => '妈醭漤栝 蝠圄酬 $1 玎 皴牦礓', - 'at which time (.*) had been up for(.*)' => '$1 涑: $2', - '([kMG]?)([bB])/s' => '$1$1/皴', - '([kMG]?)([bB])/min' => '$1$2/踱', - '([kMG]?)([bB])/h' => '$1$2/泐', - '([bB])/s' => '$1/皴', - '([bB])/min' => '$1/踱', - '([bB])/h' => '$1/泐', - 'Bits' => '岢蜞', - 'Bytes' => '徉轵圊', - 'In' => '怩充', - 'Out' => '忤醭', - 'Percentage' => '鲁漶铗铌', - 'Ported to OpenVMS Alpha by' => '项痱钼囗 磬 OpenVMS Alpha', - 'Ported to WindowsNT by' => '项痱钼囗 磬 WindowsNT', - 'and' => '蜞', - 'RED' => '着新瓮壬', - '^GREEN' => '桥伺腿', - 'BLUE' => '讶筒', - 'DARK GREEN' => '遗掏吻潘磐壬', - 'MAGENTA' => '圆嗡乓温壬', - 'AMBER' => '劣胸胰臀氯', - ); - -# maybe expansions with replacement of whitespace would be more appropriate - -foreach $i (keys %translations) -{ - my $trans = $translations{$i}; - $trans =~ s/\|/\|/; - return $string if eval " \$string =~ s|\${i}|${trans}| "; -}; - -%wday = - ( - 'Sunday' => ' 湾涑', 'Sun' => '弯', - 'Monday' => ' 项礤涑腩', 'Mon' => '享', - 'Tuesday' => ' 鲁怛铕铌', 'Tue' => '买', - 'Wednesday' => ' 彦疱溧', 'Wed' => '佯', - 'Thursday' => ' 族蜮屦', 'Thu' => '昨', - 'Friday' => ' 蟎'蝽桷', 'Fri' => '向', - 'Saturday' => ' 洋犷蜞', 'Sat' => '厌' - ); - -%month = - ( - 'January' => '殉黜', 'February' => '塔蝾泐' , 'March' => '铃疱珥', - 'Jan' => '殉', 'Feb' => '塔', 'Mar' => '铃', - 'April' => '殊瞅', 'May' => '茵噔', 'June' => '族疴', - 'Apr' => '殊', 'May' => '茵', 'Jun' => '族', - 'July' => '髓镯', 'August' => '彦痫', 'September' => '洛疱耥', - 'Jul' => '髓', 'Aug' => '彦', 'Sep' => '洛', - 'October' => '祁怛', 'November' => '髓耱铒噤', 'December' => '灭箐', - 'Oct' => '祁', 'Nov' => '髓', 'Dec' => '灭' - ); - - @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); - if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} ) - { - if($foo[3]=~(/(.*)at(.*)/)) - { - @quux=split(/at/,$foo[3]); - $foo[3]=$quux[0].". ".$quux[1]; - }; - return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; - }; - -# -# handle two different time/date formats: -# return "$wday, $mday $month ".($year+1900)." at $hour:$min"; -# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; -# - -# handle nontranslated strings which ought to be translated -# print STDERR "$_\n" or print DEBUG "not translated $_"; -# but then again we might not want/need to translate all strings - - return $string; - -}; - - # Ukrainian sub ukrainian @@ -5431,4 +5321,114 @@ foreach $i (keys %translations) return $string; }; + + +# Ukrainian1251 - windowze encoding + +sub ukrainian1251 +{ + my $string = shift; +return "" unless defined $string; + my(%translations,%month,%wday); + + my($i,$j); + my(@dollar,@quux,@foo); + + %translations = + ( + 'iso-8859-1' => 'windows-1251', + 'Maximal 5 Minute Incoming Traffic' => '锑犟桁嚯栝 怩充龛 蝠圄酬 玎 5 踱桦桧', + 'Maximal 5 Minute Outgoing Traffic' => '锑犟桁嚯栝 忤醭漤栝 蝠圄酬 玎 5 踱桦桧', + 'the device' => '镳桉蝠抽', + 'The statistics were last updated(.*)' => '务蜞眄 铐钼脲眄 耱囹桉蜩觇: $1', + ' Average\)' => ')', + 'Average' => '彦疱漤抽', + 'Max' => '锑犟桁嚯栝', + 'Current' => '项蝾黜栝', + 'version' => '忮瘃', + '`Daily\' Graph \((.*) Minute' => '腻眄栝 蝠圄酬 ( 皴疱漤祗 玎 $1 踱桦桧', + '`Weekly\' Graph \(30 Minute' => '诣骓邂栝 蝠圄酬 ( 皴疱漤祗 玎 30 踱桦桧' , + '`Monthly\' Graph \(2 Hour' => '坛黜栝 蝠圄酬 ( 皴疱漤祗 玎 溻i 泐滂龛', + '`Yearly\' Graph \(1 Day' => '谐黜栝 蝠圄酬 ( 皴疱漤祗 玎 钿桧 溴睃', + 'Incoming Traffic in (\S+) per Second' => '迈充龛 蝠圄酬 $1 玎 皴牦礓', + 'Outgoing Traffic in (\S+) per Second' => '妈醭漤栝 蝠圄酬 $1 玎 皴牦礓', + 'at which time (.*) had been up for(.*)' => '$1 涑: $2', + '([kMG]?)([bB])/s' => '$1$1/皴', + '([kMG]?)([bB])/min' => '$1$2/踱', + '([kMG]?)([bB])/h' => '$1$2/泐', + '([bB])/s' => '$1/皴', + '([bB])/min' => '$1/踱', + '([bB])/h' => '$1/泐', + 'Bits' => '岢蜞', + 'Bytes' => '徉轵圊', + 'In' => '怩充', + 'Out' => '忤醭', + 'Percentage' => '鲁漶铗铌', + 'Ported to OpenVMS Alpha by' => '项痱钼囗 磬 OpenVMS Alpha', + 'Ported to WindowsNT by' => '项痱钼囗 磬 WindowsNT', + 'and' => '蜞', + 'RED' => '着新瓮壬', + '^GREEN' => '桥伺腿', + 'BLUE' => '讶筒', + 'DARK GREEN' => '遗掏吻潘磐壬', + 'MAGENTA' => '圆嗡乓温壬', + 'AMBER' => '劣胸胰臀氯', + ); + +# maybe expansions with replacement of whitespace would be more appropriate + +foreach $i (keys %translations) +{ + my $trans = $translations{$i}; + $trans =~ s/\|/\|/; + return $string if eval " \$string =~ s|\${i}|${trans}| "; +}; + +%wday = + ( + 'Sunday' => ' 湾涑', 'Sun' => '弯', + 'Monday' => ' 项礤涑腩', 'Mon' => '享', + 'Tuesday' => ' 鲁怛铕铌', 'Tue' => '买', + 'Wednesday' => ' 彦疱溧', 'Wed' => '佯', + 'Thursday' => ' 族蜮屦', 'Thu' => '昨', + 'Friday' => ' 蟎'蝽桷', 'Fri' => '向', + 'Saturday' => ' 洋犷蜞', 'Sat' => '厌' + ); + +%month = + ( + 'January' => '殉黜', 'February' => '塔蝾泐' , 'March' => '铃疱珥', + 'Jan' => '殉', 'Feb' => '塔', 'Mar' => '铃', + 'April' => '殊瞅', 'May' => '茵噔', 'June' => '族疴', + 'Apr' => '殊', 'May' => '茵', 'Jun' => '族', + 'July' => '髓镯', 'August' => '彦痫', 'September' => '洛疱耥', + 'Jul' => '髓', 'Aug' => '彦', 'Sep' => '洛', + 'October' => '祁怛', 'November' => '髓耱铒噤', 'December' => '灭箐', + 'Oct' => '祁', 'Nov' => '髓', 'Dec' => '灭' + ); + + @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); + if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} ) + { + if($foo[3]=~(/(.*)at(.*)/)) + { + @quux=split(/at/,$foo[3]); + $foo[3]=$quux[0].". ".$quux[1]; + }; + return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; + }; + +# +# handle two different time/date formats: +# return "$wday, $mday $month ".($year+1900)." at $hour:$min"; +# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; +# + +# handle nontranslated strings which ought to be translated +# print STDERR "$_\n" or print DEBUG "not translated $_"; +# but then again we might not want/need to translate all strings + + return $string; + +};