###### 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' =>
    "Türkçeleştiren
				<a href=\"mailto:ozgurcd\@koc.net\">Özgür C. Demir</a>",
###### 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 =
  (  
     'iso-8859-1'                             => '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\)'                             => ' Ortalama)',
     'Average'                                => 'Ortalama',
     'Max'                                    => 'EnYüksek;x',
     'Current'                                => 'ŞuAnki',
     'version'                                => 'sürüm',
     '`Daily\' Graph \((.*) Minute'           => 'Günlük ($1 dakika :',
     '`Weekly\' Graph \(30 Minute'            => 'Haftalık (30 dakika :' ,
     '`Monthly\' Graph \(2 Hour'              => 'Aylık (2 saat :',
     '`Yearly\' Graph \(1 Day'                => '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'
     'In'                                     => 'Giriş',
     'Out'                                    => 'Çıkış',
     'Percentage'                             => 'Yüzge',
     '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]"; 
    };
}
