1###### PATCHTAG00 #################################################### 2### Ukrainian/��������� 3### => Olexander Kunytsa <xakep@snark.ukma.kiev.ua> 4###### PATCHTAG10 #################################################### 5 &ukrainian1251 6###### PATCHTAG20 #################################################### 7 'ukrainian1251' => \&ukrainian1251, 8 '���������1251' => \&ukrainian1251, 9###### PATCHTAG30 #################################################### 10# Ukrainian1251/���������1251 11 'ukrainian1251' => 12 "�������� ���������� (cp1251): 13 ��������� ������ 14 <a href=\"mailto:xakep\@snark.ukma.kiev.ua\"><xakep\@snark.ukma.kiev.ua></a>", 15###### PATCHTAG40 #################################################### 16$credits::LOCALE{'���������1251'}=$credits::LOCALE{'ukrainian1251'}; 17###### PATCHTAG50 #################################################### 18 19 20# Ukrainian1251 - windowze encoding 21 22sub ukrainian1251 23{ 24 my $string = shift; 25return "" unless defined $string; 26 my(%translations,%month,%wday); 27 28 my($i,$j); 29 my(@dollar,@quux,@foo); 30 31 %translations = 32 ( 33 'iso-8859-1' => 'windows-1251', 34 'Maximal 5 Minute Incoming Traffic' => '������������ ������� ������ �� 5 ������', 35 'Maximal 5 Minute Outgoing Traffic' => '������������ �������� ������ �� 5 ������', 36 'the device' => '�������', 37 'The statistics were last updated(.*)' => '������ ��������� ����������: $1', 38 ' Average\)' => ')', 39 'Average' => '�������', 40 'Max' => '������������', 41 'Current' => '��������', 42 'version' => '�����', 43 '`Daily\' Graph \((.*) Minute' => '������ ������ (� ���������� �� $1 ������', 44 '`Weekly\' Graph \(30 Minute' => '�������� ������ (� ���������� �� 30 ������' , 45 '`Monthly\' Graph \(2 Hour' => '̳������ ������ (� ���������� �� ��i ������', 46 '`Yearly\' Graph \(1 Day' => 'г���� ������ (� ���������� �� ���� ����', 47 'Incoming Traffic in (\S+) per Second' => '������� ������ � $1 �� �������', 48 'Outgoing Traffic in (\S+) per Second' => '�������� ������ � $1 �� �������', 49 'at which time (.*) had been up for(.*)' => '$1 � 䳿: $2', 50 '([kMG]?)([bB])/s' => '$1$1/���', 51 '([kMG]?)([bB])/min' => '$1$2/��', 52 '([kMG]?)([bB])/h' => '$1$2/���', 53 '([bB])/s' => '$1/���', 54 '([bB])/min' => '$1/��', 55 '([bB])/h' => '$1/���', 56 'Bits' => '����', 57 'Bytes' => '������', 58 'In' => '����', 59 'Out' => '�����', 60 'Percentage' => '³������', 61 'Ported to OpenVMS Alpha by' => '��������� �� OpenVMS Alpha', 62 'Ported to WindowsNT by' => '��������� �� WindowsNT', 63 'and' => '��', 64 'RED' => '��������', 65 '^GREEN' => '�������', 66 'BLUE' => '��Ͳ�', 67 'DARK GREEN' => '������������', 68 'MAGENTA' => 'Բ��������', 69 'AMBER' => '�����������', 70 ); 71 72# maybe expansions with replacement of whitespace would be more appropriate 73 74foreach $i (keys %translations) 75{ 76 my $trans = $translations{$i}; 77 $trans =~ s/\|/\|/; 78 return $string if eval " \$string =~ s|\${i}|${trans}| "; 79}; 80 81%wday = 82 ( 83 'Sunday' => ' �����', 'Sun' => '��', 84 'Monday' => ' ��������', 'Mon' => '��', 85 'Tuesday' => ' ³������', 'Tue' => '��', 86 'Wednesday' => ' ������', 'Wed' => '��', 87 'Thursday' => ' ������', 'Thu' => '��', 88 'Friday' => ' �\'������', 'Fri' => '��', 89 'Saturday' => ' ������', 'Sat' => '��' 90 ); 91 92%month = 93 ( 94 'January' => 'ѳ���', 'February' => '������' , 'March' => '�������', 95 'Jan' => 'ѳ�', 'Feb' => '���', 'Mar' => '���', 96 'April' => '�����', 'May' => '������', 'June' => '������', 97 'Apr' => '���', 'May' => '���', 'Jun' => '���', 98 'July' => '�����', 'August' => '������', 'September' => '�������', 99 'Jul' => '���', 'Aug' => '���', 'Sep' => '���', 100 'October' => '������', 'November' => '���������', 'December' => '������', 101 'Oct' => '���', 'Nov' => '���', 'Dec' => '���' 102 ); 103 104 @foo=($string=~/(\S+),\s+(\S+)\s+(\S+)(.*)/); 105 if($foo[0] && $wday{$foo[0]} && $foo[2] && $month{$foo[2]} ) 106 { 107 if($foo[3]=~(/(.*)at(.*)/)) 108 { 109 @quux=split(/at/,$foo[3]); 110 $foo[3]=$quux[0]."�. ".$quux[1]; 111 }; 112 return "$wday{$foo[0]} $foo[1] $month{$foo[2]} $foo[3]"; 113 }; 114 115# 116# handle two different time/date formats: 117# return "$wday, $mday $month ".($year+1900)." at $hour:$min"; 118# return "$wday, $mday $month ".($year+1900)." $hour:$min:$sec GMT"; 119# 120 121# handle nontranslated strings which ought to be translated 122# print STDERR "$_\n" or print DEBUG "not translated $_"; 123# but then again we might not want/need to translate all strings 124 125 return $string; 126 127}; 128