Next | Tricks of the Wizards | 91 |
package Translate; use Filter::Simple;
my %lexicon = ( 'Hello there!\n' => "¡Buenos Dias!\n", 'Should I erase all your files (yes/no)? ' => '¿Debo borrar todos sus archivos (si/no)? ' 'yes' => 'si', );
FILTER_ONLY string => sub { unless (exists $lexicon{$_}) { warn qq{No translation for "$_"\n}; $lexicon{$_} = $_; } $_ = $lexicon{$_}; };
Or more likely the %lexicon will be tied to a disk database
Next | Copyright © 2003 M. J. Dominus |