Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: English to German

by lima1 (Curate)
on Jul 03, 2007 at 07:50 UTC ( [id://624611]=note: print w/replies, xml ) Need Help??


in reply to English to German

Instead of printing strings directly, write a simple wrapper:
print mt("Hello World!");
This method searches your "dictionary" for a translation. The easiest solution is a hash:
package MyNamespace::MT::German; ... sub mt { my ( $self, $phrase ) = @_; my %translations = ( 'Hello World!' => 'Hallo Welt!', ); return $translations{$phrase} || $phrase; );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://624611]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2025-01-22 18:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (63 votes). Check out past polls.