###### PATCHTAG00 ####################################################
###      Turkish/Türkçe
###      => Özgür C. Demir <ozgurcd@koc.net>
###### PATCHTAG10 ####################################################
  &turkish
###### PATCHTAG20 ####################################################
  'turkish'	 => \&turkish,
  'turkce'	 => \&turkish,
###### PATCHTAG30 ####################################################
# Turkish/Türkçe
    'turkish' =>
    "  <HR NOSHADE>
      Türkçeleştiren
     <NOBR><A HREF=\"mailto:ozgurcd\@koc.net\">Özgür C. Demir</A>
     </NOBR>",
###### PATCHTAG40 ####################################################
$credits::LOCALE{'turkce'}=$credits::LOCALE{'turkish'};
###### PATCHTAG50 ####################################################
# Turkish

sub turkish
{
  my $string = shift;
return "" unless defined $string;
  my(%translations,%month,%wday);

  my($i,$j);
  my(@dollar,@quux,@foo);

  
  # regexp => replacement string NOTE does not use autovars $1,$2...

  %translations =
  (  
     'charset=iso-8859-9'                     => 'charset=iso-8859-9',
     'Maximal 5 Minute Incoming Traffic'      => '5 dakika için en yüksek giriş trafiği',
     'Maximal 5 Minute Outgoing Traffic'      => '5 dakika için en yüksek çıkış trafiği',
     'the device'                             => 'aygıt',
     'The statistics were last updated(.*)'   => 'İstatistiklerin en son güncellenmesi $1',
     ' Average\)</B><BR>'                     => ' Ortalama)</B><BR>',
     '<TD ALIGN=right><SMALL>Average(.*)'     => '<TD ALIGN=right><SMALL>Ortalama $1',
     '<TD ALIGN=right><SMALL>Max(.*)'         => '<TD ALIGN=right><SMALL>EnYüksek;x$1',
     '<TD ALIGN=right><SMALL>Current(.*)'     => '<TD ALIGN=right><SMALL>ŞuAnki$1',
     'version'                                => 'sürüm',
     '<B>`Daily\' Graph \((.*) Minute'        => '<B>Günlük ($1 dakika :',
     '<B>`Weekly\' Graph \(30 Minute'         => '<B>Haftalık (30 dakika :' ,
     '<B>`Monthly\' Graph \(2 Hour'           => '<B>Aylık (2 saat :',
     '<B>`Yearly\' Graph \(1 Day'             => '<B>Yıllık (1 gün :', 
     'Incoming Traffic in (\S+) per Second'   => '$1 deki saniyelik giriş trafiği',
     'Outgoing Traffic in (\S+) per Second'   => '$1 deki saniyelik çıkış trafiği',
     'at which time (.*) had been up for(.*)' => '$1 Ne zamandan $2 beri ayakta',
     # '([kMG]?)([bB])/s'                      => '\$1\$2/s',
     # '([kMG]?)([bB])/min'                    => '\$1\$2/min',
     # '([kMG]?)([bB])/h'                       => '$1$2/t',
     # 'Bits'                                  => 'Bit',
     # 'Bytes'                                 => 'Byte'
     '&nbsp;In:</FONT>'                       => '&nbsp;Giriş:</FONT>',
     '&nbsp;Out:</FONT>'                      => '&nbsp;Çıkış:</FONT>',
     '&nbsp;Percentage</FONT>'                => '&nbsp;Yüzge:</FONT>',
     'Ported to OpenVMS Alpha by'             => 'OpenVMS Alpha ya uyarlayan',
     'Ported to WindowsNT by'                 => 'WindowsNT ye uyarlayan',
     'and'                                    => 've',
     '^GREEN'                                 => 'YEŞİL',
     'BLUE'                                   => 'MAVİ',
     'DARK GREEN'                             => 'KOYU YEŞİL',
     'MAGENTA'                                => 'MACENTA',
     'AMBER'                                  => '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'    => 'Pazar',		'Pzr' => 'Dom',
      'Monday'    => 'Pazartesi',	'Pzt' => 'Lun',
      'Tuesday'   => 'Salı',		'Sal' => 'Mar',
      'Wednesday' => 'Çarşamba',	'Çrş' => 'Mi&eacute;',
      'Thursday'  => 'Perşembe',	'Prş' => 'Jue',
      'Friday'    => 'Cuma',		'Cum' => 'Vie',
      'Saturday'  => 'Cumartesi',	'Cmr' => 'Sab' 
    );

%month = 
    (
 'January' => 'Ocak',    'February' => 'Şubat',     'March'     => 'Mart',
 'Jan'     => 'Ock',     'Feb'      => 'Şub',       'Mar'       => 'Mar',
 'April'   => 'Nisan',   'May'      => 'Mayıs',     'June'      => 'Haziran', 
 'Apr'     => 'Nis',     'May'      => 'May',       'Jun'       => 'Hzr',
 'July'    => 'Temmuz',  'August'   => 'Agustos',   'September' => 'Eylül', 
 'Jul'     => 'Tem',     'Aug'      => 'Agu',       'Sep'       => 'Eyl', 
 'October' => 'Ekim',    'November' => 'Kasım',     'December'  => 'Aralık', 
 'Oct'     => 'Ekm',     'Nov'      => 'Kas',       'Dec'       => 'Ara' 
    );

  @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]." a las ".$quux[1]; 
      };
      return "$wday{$foo[0]} $foo[1] de $month{$foo[2]} de $foo[3]"; 
    };
}
