package LFlanguages; # vim: set sw=4 ts=4 si et: # return a list of avaliable Language directories sub supportedLang(){ ('English','Castellano','ChineseGB','Deutsch', 'Francais','Italiano','Nederlands','Portugues','Polish','Indonesian', 'Russian','Turkce','Korean','Arabic'); } # return en for English etc... for abreviations see e.g # /usr/lib/perl5/site_perl/5.6.1/XML/RSS.pm sub ldir2short($){ my $ldir=shift; my $short='en'; # default my %langdir2lang=('Deutsch'=>'de','Francais'=>'fr','Indonesian'=>'id', 'ChineseGB'=>'zh-cn','Castellano'=>'es',Russian=>'ru',Turkce=>'tr', 'Italiano'=>'it','Polish'=>'pl','Portugues'=>'pt','Nederlands'=>'nl', 'Korean'=>'ko'); $short=$langdir2lang{$ldir} if ($langdir2lang{$ldir}); return($short); } sub lang2encoding($){ my $ldir=shift; my $code='iso-8859-1'; my %encode=( 'ChineseGB'=>'gb2312','Polish'=>'iso-8859-2', 'Indonesian'=>'iso-8859-1','Russian'=>'koi8-r', 'Turkce'=>'iso-8859-9', 'Korean'=>'euc-kr','Arabic'=>'windows-1256'); $code=$encode{$ldir} if ($encode{$ldir}); return($code); } # 1;