in reply to English to German
This method searches your "dictionary" for a translation. The easiest solution is a hash:print mt("Hello World!");
package MyNamespace::MT::German; ... sub mt { my ( $self, $phrase ) = @_; my %translations = ( 'Hello World!' => 'Hallo Welt!', ); return $translations{$phrase} || $phrase; );
|
|---|